For weeks the sky over Mexico City has kept its inhabitants guessing – one moment it has been azure and sunny; the next an ominous grey vault of clouds belly full with rain. The downpours, when they come, whip flash floods across streets and topple trees.

"At my age you learn to be ready for anything," said Mario Rojas, 86, clutching an umbrella and tramping in rubber boots across Avenida Alvaro Obregón to his tailor's shop. He wasn't referring to the weather. "This vote, God knows what happens after."

Mexico elects a new president and congress on Sunday, after a fraught campaign that has shone a harsh light on its fledgling democracy. Whoever wins the keys to Los Pinos, the presidential mansion, will inherit a country as uncertain as its current weather and a people demoralised by the seemingly never-ending "war on drugs".

Polls suggest that the conservative Institutional Revolutionary party (PRI), which ruled through patronage and repression from 1929 to 2000, will reclaim power with the telegenic Enrique Peña Nieto – a stunning comeback for a movement once consigned to history's dustbin. "We will reduce poverty and regain peace and security in the whole country," he told a final rally.

His main challenger, Andrés Manuel López Obrador, of the leftwing Party of Democratic Revolution (PRD), filled the Zócalo plaza with 100,000 supporters and thundered that he would win. If he does not, Mexico will hold its breath to see if the fiery leader will cry fraud and paralyse the city centre with months of protest, as he did after narrowly losing the 2006 election. "I will govern for rich and poor, for the people in the cities and the people in the farms," he said.

Josefina Vázquez Mota of the ruling conservative National Action party, trailing third in the polls, promised a miracle if supporters did their part. "God always does his!" She urged women to withhold cuchi cuchi – sex – unless their partners voted for Mexico's first female presidential candidate.

Almost 80 million Mexicans are eligible to vote at more than 143,151 polling places throughout a varied landscape: the sheen of Monterrey's skyscrapers, the dust of Oaxaca's villages, the sprawl of Mexico City. In addition to a president, who will serve a single six-year term, voters will choose 500 members of the lower house of congress, 128 senators and a clutch of mayors and governors.

The fate of the drug war, the nation's lumbering economy, the yearning for jobs and development and safety, all hang in the balance. Duelling murals and political posters all promise cambio, change. But change for the better?

From afar it may seem as if Mexico can hardly get worse. President Felipe Calderón's declaration of war against drug cartels in 2006, just after his inauguration, triggered violence costing 50,000 lives and introduced beheadings and mass graves to a country previously better known for margaritas.

The violence continued last week. Marisol Mora Cuevas, the kidnapped mayor of Tlacojalpan, was found hanged. A navy helicopter crashed in the western state of Jalisco – possibly shot down after flying over a meth lab – killing four marines.

Two federal police officers shot dead three colleagues in the food court at Terminal 2 of Mexico City's Benito Juárez international airport, prompting contradictory official statements and suspicion of a drug-related dispute. "They don't even know who were the good guys and who were the bad guys," fumed a columnist in the newspaper Reforma.

Yet the drug war has barely figured in the election. "It's the absent issue. The candidates don't know what they'd do differently, so they don't really talk about it," said Denise Dresser, a political analyst at the Autonomous Technical Institute of Mexico. Instead the concern has been whether the PRI, whose 20th-century grip on power was called a "perfect dictatorship" by Mario Vargas Llosa, the recipient of the 2010 Nobel prize for literature, can be trusted with Mexico's fragile democracy should it win.

"The best word to describe the mood is uneasy," said Dresser. "The PRI have a fresh face, but the fear is they will slowly erode democratic freedoms to make sure that they're never ousted from power again."

Peña Nieto sought to defuse such concern in an interview with the newspaper El Universal. "There is a new PRI. It's the others who have not changed. They are living in the past." The party, he said, had governors and mayors who had evolved alongside Mexico over the past decade. "The PRI never left. It has lost and won, competed democratically and understood change."

The party's resurgence is rooted partly in exhaustion from the violence. Calderón's PAN party is promising, in effect, more of the same military-led assault on cartels to stifle the drug trade. A fiasco over the supposed capture of the son of drug kingpin Joaquín "El Chapo" Guzmán – the suspect turned out to be a car salesman – further eroded confidence in the existing approach.

Peña Nieto, 45, in contrast, has promised to focus on preventing kidnappings, muggings and other crimes that plague daily life. If that means turning the clock back to when corrupt PRI governments peacefully coexisted with the cartels, so be it, say some party supporters. "There was a time when corpses didn't dangle from motorway overpasses. We'd like that back," said one trade union official.

The PRI is also benefiting from disappointment at 12 years of lacklustre economic growth under its conservative rival, PAN. Under Vicente Fox, then Calderón, the party tamed inflation, stabilised the currency and balanced the budget. However, the promised boom in living standards never arrived, leaving 46% of Mexicans still trapped in poverty, many of them in conditions resembling those in sub-Saharan Africa, lacking clean water and basic services. Nor did PAN modernise an economy dominated by monopolistic behemoths.

The halt in mass migration to the US, a traditional safety valve, owed more to US economic woes and border controls than a sudden surge in opportunities at home.

The PRI's formidable electoral machine – sustained during its exile from the presidency by young governors such as Peña Nieto – has tapped into economic discontent with promises of more jobs and better wages. Allegations of vote-buying – officials have been filmed offering mattresses, cash and electrical goods – have been shrugged off. Peña Nieto has had more difficulty rebuffing accusations of buying positive coverage from Televisa, Mexico's media giant.

The protests seem unlikely to derail his victory, but the message has resonated. "See this?" said Rojas, the tailor, brandishing a newspaper which he had rolled up in his umbrella. "Propaganda, bought and sold. Can't believe any of it." Would he vote? "Of course. They're all crooks, but as a citizen it's my duty to vote. Vote and hope." © Guardian News and Media 2012