Amid President Donald Trump's tough-sounding talk about renegotiating the North American Free Trade Agreement, economists and other observers have debated how potential changes could impact the U.S. economy.

Less scrutinized is how Mexico, the United States' third-largest trading partner and a frequent target of Trump's broadsides on trade and immigration, might be affected by adjustments to the decades-old trade agreement.

At least a few economists are outlining scenarios in which Mexico could emerge as an unlikely winner in the brewing debate. The discussion takes place against a backdrop of Mexican growth that's less than stellar, but has beaten some of the more dire predictions about how the country could fare as the Trump era takes shape.

"The Mexican economy has its problems, but it has arguably been the best-performing Latin American economy in recent years," Mark Zandi, chief economist at Moody's Analytics, told CNBC in an interview.

"It has become less dependent on the ups and downs in oil prices, and more integrated into the global supply chain," Zandi added. "Given its young population, Mexico has a bright economic future, particularly if it is able to address its problem with crime and corruption."

Indeed, citing "a more constructive mood"— one that presumably assumes NAFTA will be reformed rather than shredded — Citigroup recently upgraded its outlook for Mexico's economy to an expansion of 1.7 percent this year from an earlier projection of 1.2 percent growth. That revision was in part "predicated ... on a more constructive assessment of what the future of North American integration might look like," the bank's analysts wrote in a research note last week.

"On the relationship with the U.S. there appears to have been a rethinking of trade issues within the Trump administration," Citi said. "We now think that NAFTA will be 'rebalanced' but also 'upgraded'" in ways that may prove beneficial to Mexico, the bank added.

Citi's remarks reflected a growing consensus among analysts that Trump's hard-line approach to trade as a candidate is giving way to more practicality as a president. That dynamic was underscored when Trump told CBS in an interview last week that he was open to renegotiating NAFTA — but warned that he was willing to abrogate the pact if talks between Canada and Mexico proved fruitless.