NEW YORK, Jan 29 (Reuters) - A Brazilian appeal court's conviction of former President Luiz Inacio Lula da Silva last week eased investor fears of the leftist winning this year's presidential vote, shifting the spotlight to Mexico where another populist leads in the polls.
The Brazilian market has led strong gains by Latin American stocks over the past two years as President Michel Temer passed market-friendly laws. But the prospect of a Lula victory in October's election - for which he tops surveys of voting intentions - threatened investors' optimism.
While Lula has pledged to continue his campaign, Wednesday's court decision makes it all but impossible for the 72-year-old former union leader to run. Brazilian law bans political candidates whose convictions have been upheld by an appellate court.
In Mexico, by contrast, polls show leftist Andres Manuel Lopez Obrador, known as 'AMLO', consolidating his lead ahead of the July election.
An opinion poll on Monday gave Lopez Obrador 32 percent of voting intentions, ahead of conservative Ricardo Anaya on 26 percent.
Investors in Mexico, Latin America's second-largest economy after Brazil, must also contend with fears about a potential U.S. withdrawal from the North American Free Trade Agreement (NAFTA).
Will Pruett, portfolio manager at Fidelity Investments, said he expected Brazil to continue its outperformance as Lula's conviction increased the prospect of victory by a centrist candidate who would pursue market-friendly policies and a turnaround at state-owned businesses like Petroleo Brasileiro SA .
While financials and consumer stocks in Brazil offered attractive valuations, Pruett said, in Mexico cheap stocks are hard to find.
"With potential shocks with NAFTA and AMLO, I don't think the risk-reward is great right now," he added.
More than 80 percent of Mexico's exports head to the United States but U.S. President Donald Trump has threatened to scrap NAFTA if he cannot win more favorable terms. The latest round of talks in Canada concluded on Monday without a breakthrough.
Among other factors unsettling investors in Mexico, Lopez Obrador has vowed to review oil contracts signed with foreign investors under the sweeping 2013-2014 reforms that dismantled a decades-long monopoly by state oil firm Pemex .
"If he goes through and reopens every contract signed with Pemex or involving other forms of infrastructure, that halts things," said SMBC Nikko emerging market analyst Roger Horn. "You need foreign investment to come in."
Latin American stocks have surged by 75 percent since the beginning of 2016 with debt prices also gaining 25 percent over the same period, as measured by the JPMorgan Latin American sovereign bond index.
Mexico underperformed Brazil during that period and T. Rowe Price fund manager Verena Wachnitz believes that the combination of Loprez Obrador and NAFTA doubts will weigh on Mexican stocks in the coming months.
"Both are quite negative potentially for Mexico," Wachnitz said.
She and other investors said that even in the unlikely circumstance that Lula wins the right to contest the election by appealing to the Supreme Court, his chances look weaker than Lopez Obrador's given Brazil's two-round voting system.
That makes it tougher for a candidate with Lula's high disapproval rating to pull off a final victory.
In contrast, Mexico's single round, winner-take-all approach offers a smoother path to Lopez Obrador, who could succeed in uniting voters lured by his anti-corruption message against a more splintered pro-establishment vote.
"Both AMLO and Lula are candidates with a high floor and a relatively low ceiling in terms of voter intentions," said Alejo Czerwonko, EM chief investment officer at UBS. "These candidates can do well in single-round systems but can face an uphill battle in two-round ones."
Still, he said investors should take into account Lopez Obrador's track record of pragmatism while mayor of Mexico City, when he forged alliances with business leaders to push through legislation.
The 64-year-old has pledged to spend more on the elderly, young people and farmers to combat inequality, but has steered clear of a hard-left agenda.
And Mexico's outgoing President Enrique Pena Nieto has pushed through structural changes to energy, banking, tax and competition which should endure no matter which party wins.
"Reforms are not going to be reversed," said Mauro Roca, Latin America sovereign debt analyst at fund manager TCW. "At most there could be a change in the pace and the direction of their implementation."
Brazil, meanwhile, urgently needs a leader who will tackle its deficit, most likely by reviving a politically delicate pension overhaul. Otherwise, Brazil's debt-to-GDP ratio could balloon to 75 percent by the end of 2018, according to UBS.
While the investment bank forecasts Mexico's 2018 budget deficit at just 2.4 percent in 2018, Brazil's is seen at 6.2 percent, Czerwonko said.
He is nevertheless more bullish about Brazil, citing its recovering economy, which is expected to grow by almost 3 percent this year after emerging from recession in 2017. He says Mexico is "trickier."
"We don't have the conviction to call the election or the NAFTA outcome at the moment," Czerwonko said. (Reporting By Christian Plumb; Editing by Daniel Flynn and Rosalba O'Brien)