Win or lose, Mr. Rodríguez’s campaign has been entertaining.

Anyone who criticizes him is a “prude,” or something unprintable in a family newspaper. In fact, when he gets going, not much of what he says is printable, and he makes no apologies about it, either.

“This is just how I speak, as everyone does in the north of the country,” he said. “People from other parts of the country are too formal and square and do not understand it. Here, we curse even when confessing to priests.”

Mr. Rodríguez has been a rancher most of his life and stumbled into politics, he said, when he was 20 and began working for the governor at the time.

He held a number of political positions before running for mayor of García, a farming suburb of Monterrey, in 2009 to kick out drug gangs.

At the start of that campaign, he said, his 2-year-old daughter was briefly kidnapped by criminals, but he did not report it to the police out of fear of reprisals; there is no way to verify his account. After he was elected, his 22-year-old son disappeared and was found dead seven days later; he suspects that it was part of a kidnapping.

Mr. Rodríguez took on the gangs through social media, urging residents to report problems on Twitter and Facebook, with Mr. Rodríguez directing the police to address them. He said gangs had opened fire on his car on a couple of occasions, an account supported by some news reports.