By Diego Oré and Carlos Carrillo

MEXICO CITY (Reuters) - As Mexicans head to the polls on Sunday to elect their next president and thousands of state and local posts, much of the country is suffering historic drought, intense heat, and occasional power blackouts.

Water shortages may not be a new phenomenon in the Latin American country, especially in the populous capital Mexico City, but some voters are blaming the ruling MORENA party for the crisis and analysts say it could prove an important factor in the upcoming election, particularly in some closer-fought local races.

MORENA candidate Claudia Sheinbaum is still heavily favored to win the presidency, with some polls giving her a 20 point advantage over main opposition candidate Xochitl Galvez, a senator with the center-right National Action Party.

Whoever wins will have to contend with water shortages, with 30 of 32 Mexican states in drought, according to a May 15 chart from national water commission Conagua.

"I hope that whoever comes in will solve this problem," said Isabel Aleman, a 74-year-old resident of Ecatepec, the most populated municipality in Mexico State, just outside the capital.

"They promise the sun and the moon to get elected, and then they forget about their neighbors," she added as she waited for a truck to deliver water to her home.

Dwindling rainfall, outdated infrastructure and the El Nino weather phenomenon have contributed to particularly strong droughts, experts say.

In Ecatepec and in many areas of Mexico City, the mega capital of 10 million people, tens of thousands of people have been without regular running water.

To get by, they wait for public water trucks or pay for their own private deliveries, an unwelcome expense for many of Mexico's poor who already struggle to make ends meet.

The opposition has been swift to frame the water crisis as a result of poor governance by the ruling party. Clara Brugada, the MORENA candidate for Mexico City mayor and former leader of Iztapalapa, is the target of heavy opposition criticism.

"If the water doesn't reach you, don't vote for MORENA," read opposition campaign posters in Iztapalapa and across Mexico City.

MEXICO CITY UP FOR GRABS

Until late last year, Brugada was polling comfortably in front. But her campaign started losing momentum as water shortages, a lack of rain, and record high temperatures became daily headlines.

Brugada, who held a 15 percentage point advantage in November, now polls just five percentage points ahead of opposition candidate Santiago Taboada, according to a May survey by Mexican newspaper El Financiero.

Taboada has promised to help improve the water situation by increasing rainwater recycling and the fixing leaks, which result in huge water waste.

In an attempt to boost Brugada's popularity, Sheinbaum has upped her presence at rallies in Mexico City since mid-April.

Losing Mexico City would be a major political blow for leftist MORENA, which has come to dominate Mexican politics since winning the presidency in 2018.

It would also give the opposition hope and a vital political foundation to build on.

"Without a doubt, the government is concerned about winning Mexico City," said Antonio Ocaranza, a consultant and former spokesman for President Ernesto Zedillo who ruled from 1994 to 2000 with the Institutional Revolutionary Party.

A win for Taboada would build the opposition's momentum ahead of 2030, the next presidential elections, Ocaranza said,

"His victory... would be a blow for Claudia Sheinbaum who governed this city for five years and couldn't manage to install her party's candidate in place," he added.

(Reporting by Diego Ore and Carlos Carrillo; writing by Cassandra Garrison; editing by Stephen Eisenhammer)