Metro-North cruelly outed a pre-op transgender worker and then ignored his colleagues’ hateful attacks until they culminated in assault, according to a lawsuit.

Shine Williams, 43, was born “Sheri” but has spent more than 20 years living and working as a man, and has undergone testosterone treatments, he says in court papers.

Just a month after he was hired as a Metro-North coach cleaner in 2010, human resources executives claimed someone complained about a woman in the men’s locker room at Williams’ North White Plains workplace.

That prompted a review of Williams’ records, which included a driver’s license listing him as female.

The HR reps forced Williams to redo his Metro-North paperwork to change male pronouns to female ones. They also required him to use his birth name and switch locker rooms.

Years of discrimination followed, Williams said. He claims it came to a head in October, when a female coworker squeezed his crotch and asked: “How does it work? How big is it?”

The alleged attacker, Meldeisha McMillian, was arrested on sexual abuse and forcible touching charges.

After the railroad’s “cruel acts of misgendering,” Metro-North officials ignored complaints that coworkers taunted Williams with phrases like, “He-She,” and “hermaphrodite.”

Williams said he was also taunted by references to “Boys Don’t Cry,” a 1999 movie about the rape and murder of transgender Nebraskan Brandon Teena.

“Metro-North did nothing,” alleges Williams, who seeks unspecified damages and a court-appointed monitor to ensure Metro-North stops ignoring discrimination.