Mexico's ruling Institutional Revolutionary Party appears poised to retain its leading position in Congress, but may lose some governor seats in Sunday's elections.

The last polls to be released before Sunday's midterm elections show surprisingly resilient support for the ruling party known as the PRI, despite Mexicans' general dissatisfaction with politics and a lackluster economy.

A poll by the GEA-ISA companies suggests the PRI would get about 27 percent of votes for the lower house of Congress, well ahead of its closest competitor, the conservative National Action Party, at 21 percent. The poll had a margin of error of plus or minus 3 percentage points.

Findings in the same poll nevertheless showed that 67 percent of the 1,100 people interviewed were dissatisfied with the way Mexico's democracy is working, and a general lack of trust in political parties.

The PRI may be benefiting from a slight uptick in perceptions of the economy's performance. GDP grew by 2.5 percent in the first quarter of 2015, above the 2014 annual growth rate of 2.1 percent, but still well below the government's original predictions of at least 3.2 percent for 2015.

A survey by the polling firm BGC also showed the PRI in first place in the congressional races, about 6 percentage points ahead of National Action, while a poll by the Buendia & Laredo company placed the PRI's lead at about 4 percent. The margins of error were plus or minus 2.9 percentage points and plus or minus 3.6 percentage points, respectively.

"In the federal elections, the PRI is going to win," said Luis Carlos Ugalde, the country's former top electoral watchdog official. "It means that the economic situation has many people in a good mood, it means that a portion of the population is doing more or less okay."

But, paradoxically, most of the races for governorships in nine of Mexico's 31 states are extremely close, in many cases too close to call. The PRI had long dominated most statehouses, and some states have always had PRI governors.

"There is an enormous level of competition, and that is very good news," said Ugalde.

In the most closely-watched governorship race, in the northern border state of Nuevo Leon, some polls showed a surprising surge for Jaime Rodriguez, an independent who is running under his nickname, "El Bronco," to challenge the PRI.

A poll by the newspaper El Universal showed Rodriguez neck-and- neck with PRI candidate Ivonne Alvarez, at 30.1 and 29.1 percent, respectively. The poll had a margin of error of plus or minus 3.1 percentage points.

Other surveys showed one or the other of the Nuevo Leon candidates with a wider lead. But the surprising thing was that Rodriguez, with no support from any political party, was in the running at all.

"Almost nobody thought an independent candidate could win a governorship," said Jose Antonio Crespo, a professor at Mexico's Center for Economic Research and Teaching. "So this is a surprise, it does set a precedent, and it will be a warning sign for the political parties."

He was referring to widespread distrust of political parties. Only about 9 percent of people in the GEA-ISA poll expressed confidence in them.

All parties have been affected by that distrust. In the northern state of Sonora, National Action currently holds the governorship. But repeated scandals have put the party's candidate Javier Gandara in a statistical tie with Claudia Pavlovich, according to an El Universal poll that had a margin of error of plus or minus 3.1 percentage points.

What also remains in doubt is whether the PRI will get enough congressional seats through a complex formula of proportional representation to be able to cobble together a majority with smaller parties.

The PRI's main ally, the Green Party, has been polling between 5 and 9 percent, which isn't enough to give the PRI a functioning majority.

Former presidential spokesman Ruben Aguilar said the PRI appears stuck at a certain level.

"The PRI has a hardcore support of 30 percent," Aguilar said, "which it hasn't managed to expand, and it isn't looking farther afield."