A decade ago, when I arrived in Mexico City to start a happy stint reporting for the Financial Times, there was a lively debate about Brazil. Who was the true economic leader of Latin America? To Mexicans, the debate seemed unnecessary.
Although Mexico has a smaller population, it had completed its recovery from the Tequila Crisis of 1994.
It had at last made a democratic transition, with the wresting of the presidency from the Institutional Revolutionary party in 2000.
It even had a robust banking system. And to judge by its weighting in the MSCI Emerging Markets index, the widely used benchmark, Mexico was the biggest of all the emerging markets.
Brazil, meanwhile, was only just emerging from its own currency crisis, while investors were terrified it was about to elect a dangerous leftwinger, Luiz Inácio Lula da Silva.
Any battle appeared over. Mexico had established itself as Latin America's leading light.
The story of the rivalry between Brazil and Mexico in the 10 years since then is painful, at least for those of us who care about Mexico.
Brazil is now one of the "Bric" nations, ranking behind only China among emerging markets. Mexico has been left far behind.
What went wrong?
Some reasons are well rehearsed. First, politics. Mexico's institutions were weak, and have weakened further as a result of the democratic transition. Without a strong PRI president binding the system together with patronage, power has splintered to the regions.
Constitutional reform is necessary, but is almost impossible to achieve.
Further, Mexico chose the wrong politicians. Vicente Fox, the centre-right politician who broke the PRI's stranglehold in 2000, had a mandate but turned out to be a very poor politician.
His successor, Felipe Calderón, had a much weaker mandate after a bitterly contested election. Although a much sharper politician, he made the strategic mistake of picking a fight he could not guarantee he would win, with the drug barons. This has bogged down his presidency.
In Lula, we now know, Brazilians chose themselves a great politician.
Then there is the problem of Mexico's place in the global economy. It is tightly linked to the U.S., and pulled itself out of trouble after 1994 in large part through its membership of the North American free-trade agreement (Nafta).
But China's entry to the World Trade Organization drastically undercut its manufacturers, who lost business to a bigger rival with cheaper labour costs.
Brazil had it in reverse. Its economic model benefits from the growth of China, the destination for many raw materials exports, and is not so reliant on the U.S. Unlike Mexico, it had the right commodities to sell at the right time.
Finally, there is the issue of political and business culture. Mexico is controlled by oligarchies and oligopolies. It is chronically uncompetitive. The same is true to an extent of Brazil, but it has found better ways to deal with it.
Look at the contrasting fortunes of the two countries' attempts to persuade companies to list on the stock exchange.
In Brazil, the Bovespa's Novo Mercado, launched in 2000, soon turned into a vibrant forum to raise funds, hosting more than 100 initial public offerings.
Mexico's repeated efforts to do something similar have been stifled by the entrenched interests of its oligarchies.
But perhaps the deepest reason why Mexico came up short has to do with outsourcing. By joining Nafta, Mexico's political elite forced the country into accepting the regulatory norms of the rest of North America. Companies that now had the chance to compete in the U.S. and Canada would have to behave like their U.S. and Canadian competitors.
Meanwhile the result of the successful resolution of the 1995 banking disaster - which saw more than half of Mexican loans written off - was to outsource virtually the entire banking system's balance sheet to foreign banks. By the time HSBC bought Bital in 2002, more than 90 per cent of the country's banking system was in foreign hands.
This was in many ways an enlightened policy. With strong banks, it was easier to run the tight fiscal and monetary policies that have solved the country's inflation problem. It now runs at barely 3 per cent - a lower rate even than in the U.K., let alone Brazil.
The problem is that by enlisting the help of Citigroup, BBVA, Santander and others, Mexico inadvertently imported the post-Lehman credit crunch. Its recession in 2009 was appalling, as the economy contracted more than 9 per cent.
Meanwhile, Brazil and the big South American commodity producers suffered only a brief and shallow contraction.
This, more than anything, explains why investors have flocked to Brazil. The appeal of emerging markets and the Brics lies in providing a hedge to the travails of the U.S. and western Europe. This is something Mexico does not offer.
But Brazilian triumphalism would be no better placed than Mexico's confidence was a decade ago.
After years of macroeconomic orthodoxy, Mexico has the building blocks in place to surprise many. It needs its powerful northern neighbour to fare well, and it needs politicians who can break a decade of deadlock, but there may yet be something to debate.
Copyright The Financial Times Ltd. All rights reserved.
Follow us on Twitter: