Standing in front of an image of a ballpark and staring into the camera, the former Houston Astros baseball star Lance Berkman had an important message to impart. Not regarding the Astros’ improbable march to the playoffs, but about men in women’s bathrooms.

“I played professional baseball for 15 years but my family’s more important. My wife and I have four daughters and Proposition One will allow troubled men who claim to be women to enter women’s bathrooms, showers and locker rooms,” the ex-slugger said.

'Papers to pee': Texas, Kentucky and Florida consider anti-transgender bills Read more

“It’s better to prevent this danger by closing women’s restrooms to men rather than waiting for a crime to happen. Join me to stop the violation of privacy and discrimination against women. Vote no on Proposition One. No men in women’s bathrooms, no boys in girls’ showers or locker rooms.”

The man nicknamed Big Puma was referring to a question posed to Houstonians as part of the city’s mayoral election on 3 November: should the city keep its equal rights ordinance?

Voters will be asked: “Are you in favor of the Houston Equal Rights Ordinance, Ord. No. 2014-530, which prohibits discrimination in city employment and city services, city contracts, public accommodations, private employment, and housing based on an individual’s sex, race, color, ethnicity, national origin, age, familial status, marital status, military status, religion, disability, sexual orientation, genetic information, gender identity, or pregnancy?”

On the face of it, the law banning all kinds of discrimination hardly seems controversial – especially not in the nation’s fourth-largest city, and one of its most diverse, where the three-term mayor is an openly lesbian Democrat. Especially not when more than 200 cities nationwide, including all the other major urban areas, Dallas among them, have passed similar laws.

Yet somehow, the ordinance, dubbed Hero, has triggered an 18-month battle waged in the courts and the media that has spanned allegations of suppressed religious freedom, petition-rigging and helping sexual predators, and turned a local issue into a national fight between Christian conservatives and LGBT rights activists.

Despite the ordinance’s wide scope, opponents have zeroed in on bathrooms, producing a creepy TV commercial that shows a girl about to be attacked in a restroom. “Any man at any time could enter a women’s bathroom simply by claiming to be a woman that day. No one is exempt, even registered sex offenders,” warns the voiceover.

Above all, perhaps, it has underlined that in a year of remarkable progress for LGBT rights, the rearguard action remains dogged and vocal in some parts of the country. Not least in Texas, where there are no statewide non-discrimination protections for LGBT residents.

Houston’s city council passed the ordinance 11-6 in May last year. Amid protests by Republicans and church leaders, the mayor, Annise Parker, removed language stating that no business could deny a transgender person access to the restroom consistent with his or her gender identity.

This was not enough for a group that submitted a petition in a bid to force a repeal referendum, then sued after the city declared that it fell short of the required threshold because many signatures were invalid.

Then the city made a political misstep when it tried to subpoena sermons from anti-ordinance pastors, outraging the religious right and prompting Republican presidential hopeful Rand Paul to allude to the row during the first GOP debate last August. “When the government tries to invade the church to enforce its own opinion on marriage, that’s when it’s time to resist,” he said.

Ultimately, Hero ended up in the Texas supreme court, which in July ruled that it must be repealed or placed on a ballot.

With turnout expected to be low in next month’s election (early voting has already begun), both sides are trying to mobilise support in the knowledge that an effective PR campaign could be decisive.

One of the mayoral candidates, Ben Hall, is campaigning on a “no men in women’s bathrooms or boys in girls’ locker-rooms” platform.

Texas’s lieutenant governor, Dan Patrick – the state’s second-most powerful politician – echoed that stance, while in a sermon, Ed Young, senior pastor at one of the country’s biggest Baptist mega-churches, thumbed through a copy of the ordinance and said it opens up the city “to something that I think is absolutely Godless”.

Proponents of the ordinance point out that sexual assault is, of course, already illegal in any situation, and the city has long had a law that specifically bans entering a restroom of the opposite sex with malicious intent. Nor is there any evidence of transgender people entering bathrooms to commit assault in other cities following the passage of similar laws.

They also argue that scrapping the ordinance would have a negative impact on the city’s image that might harm businesses, especially at a time when sports events will bring Houston national attention.

The city will host college basketball’s men’s Final Four next April and the Super Bowl in 2017. Yet Bob McNair, the owner of the NFL’s Houston Texans and a major GOP donor, gave $10,000 to the anti-Hero Campaign for Houston.

After a backlash, McNair said in a statement on Friday that he made the donation because he felt the ordinance needed “a thoughtful rewrite” and asked for the money back after Campaign for Houston “made numerous unauthorized statements about my opposition to Hero”. He said that he does not “believe in or tolerate personal or professional discrimination of any kind”.

Ellen Cohen, a council member in favour, said that the ordinance is backed by a wide range of business groups and that “it’s not a ‘GLBT equal rights bill’ – it’s a bill that includes the GLBT community … the issue is equal rights for all. I think that if people are looking to find a reason [to fight it] then it becomes a bathroom issue.”

Earlier this year, Texas state lawmakers unsuccessfully proposed a raft of “bathroom bills”, which would have criminalised transgender people for not using the restroom that comports with their biological sex at birth. Other states have tried similar measures.

Mara Keisling, executive director of the National Center for Transgender Equality, said that the tide is turning in favour of equal rights and that the Houston conflict is “a death rattle” for opponents. “It’s quickly becoming an average person thing versus a radical person thing. We’re not the radicals any more,” she said.

Still, given Houston’s size and influence, some activists worry that if the “bathroom predators” spin is persuasive, such fear-mongering could be used as a blueprint in other large cities where there are people who want to frustrate or repeal equal-rights provisions.

“Certainly the tactic was used in Fayetteville, Anchorage, and other cities. If it works here, if Hero is defeated, the bathroom argument will gain steam,” said Daniel Williams of Equality Texas, an LGBT rights group. “We’ve got the numbers on our side. All they’ve got is a very scary line.”