Although the market capitalization of Brazil's bourse is three times that of Mexico's, the Mexican stock market's standing with fund investors has been on a slow and steady rise since the end of last year, according to data from EPFR Global, which tracks funds with $16 trillion in global assets.
Slow and steady economic growth, at an annual rate of 3 to 4 percent, is also earning Mexico a second look from those with money to invest in the region despite renewed fears about the future of the euro zone and the chance of a Lehman-style global crisis.
Mexico, which has resisted the temptation to change interest rates, intervene in currency markets or battle capital inflows in recent years, is in part benefiting from Brazil's unsettling changeability in key policy areas as well as its own ties to the perceived 'safe haven' of the United States.
As risk aversion has flared again this year, Brazil's exchange suffered a bigger hit than Mexico's, suggesting investors may be more willing to hold on to Mexican stocks in crunch times. First-quarter foreign inflows into Mexican stocks were the largest since the third quarter of 2009.
"Recently I find that we have been putting more money to work in Mexico at the expense of Brazil," said Ed Kuczma, investment analyst for two Van Eck emerging market equity funds which had $275 million assets under management as of April 30.
"I think investors are starting to see a kind of top-down, favorable macro environment for Mexico and a more challenging environment for Brazil."
After an impressive 7.5 percent expansion in 2010, Brazil's economy, which is twice the size of Mexico's, slowed last year to a modest 2.7 percent, less than half the growth recorded by Peru, Colombia, Chile or even Ecuador.
Brazil's economic well-being is closely tied to commodity prices and demand from China, where growth is easing and which would be particularly vulnerable to a collapse in demand from Europe, its biggest export market. Italy and Spain have slid back into recession while France is stagnating.
Experts are concerned about the hit to Latin America's economy from a fresh euro zone crisis, a topic to be discussed at next week's Latin America Reuters Summit, which will be attended by the finance ministers of Brazil, Peru, Colombia, Chile and Mexico.
While economists have been cutting back growth projections in Brazil, many have upgraded their outlooks for Mexico, where policymakers are optimistic 2012 growth will near 4 percent on the back of stronger U.S. demand for manufactured goods and a view that the United States might hold up in the face of a fresh European crisis.
"There's a general sense of Mexico might be more slow and steady, if you like, but more stable at the same time, whereas Brazil has been on this roller coaster ride," said Neil Shearing, economist at Capital Economics in London.
"Real strains are starting to emerge in its growth model."
Still, EPFR data show fixed income funds are sticking with Brazil, where benchmark interest rates are among the dearest in the world at 9 percent. In real terms, Brazilian rates are about 4 percent, compared to Mexico's 1 percent.
Mexico's stock market is shallow and illiquid compared to many of its emerging market peers, with many big companies controlled by family interests, such as Carlos Slim's America Movil (>> America Movil SAB de CV) and baker Grupo Bimbo (>> Grupo Bimbo S.A.B. de C.V.).
But in an emerging market rout, fund managers said Mexico, which has so far escaped an economic hit from its war against drug cartels, would gain from being the least-worst option.
"There's so much money around, where are you going to put it?" said a strategist with a major fund, who declined to be named. "It's the tallest midget competition, everyone is tiny ... but you have to choose one, so who are you going to choose? You choose the tallest one."
Mexican officials also point to the ease of entry in the country's markets, with no need for foreign investors to register with authorities, unlike Brazil; no withholding tax; no minimum investment period and a freely convertible currency.
"We have a flexible and modern legal framework compared to other emerging markets. This makes it much easier for the foreign investor to take a position in Mexican assets," said Jorge Alegria, head of Mexico's MexDer derivatives exchange.
Foreign investment represents 32 percent of the Mexican market's cap. Comparative figures are not available for Brazil, but foreign investors accounted for about 40 percent of share transactions so far in May.
Brazil's benchmark Bovespa stock index <.BVSP> is down more than 11 percent so far this month, on track for its worst monthly loss since the depths of the global crisis in October 2008.
Brazilian stock market data shows that between May 1 and 18 there was a net 2.543 billion reais ($1.21 billion) outflow in foreign investment in equities, although year-to-date data are still positive at $1.29 billion.
In Mexico, where the IPC index <.MXX> has fallen more than 5 percent this month, central bank data show foreign investment inflows in company equity of close to $2 billion between January and the end of April.
Equity investors have been put off Brazil by a tax on financial transactions by foreigners, one of the measures put in place by President Dilma Rousseff's government last year to tame the then-appreciating real.
And many feel the country has been overbought after years of frenzied interest, which drove more than 100 companies to go public between 2006 and 2007 and sent share prices above levels easily justified by economic fundamentals.
Brazil's market is seen as a play on China and top oil producers and miners are vulnerable to a downturn in commodity prices while its homebuilders, credit card firms and banks may suffer if credit expansion proves to have been too excessive.
"It's very hard to find investment ideas that are not very, very expensive," said Fred Searby, Latin America equity strategist at Deutsche Bank, adding that many Brazilian companies are trading at inflated price to earnings ratios.
Brazilian retailer Lojas Americanas (>> Lojas Americanas SA) is more expensive than Mexico's Wal-Mart de Mexico (>> Wal-mart de Mexico S A B de C V) on a price to earnings ratio, and Brazilian brewer Ambev (>> Companhia de Bebidas das Americas-AmBev) outprices Corona-maker Grupo Modelo (>> Grupo Modelo SAB de CV).
Still, Mexican companies are more expensive than their Brazilian peers in the banking and telecommunications sectors, with Banorte (>> Grupo Financiero Banorte SAB de CV) and America Movil ahead of Itau Unibanco (>> Itau Unibanco Holding SA) and Telefônica Brasil <VIVT3.SA> (>> Telefonica Brasil SA).
($1 = 2.0940 Brazilian reais)
(Additional reporting by Michael O'Boyle in Mexico City, Asher Levine in Sao Paulo, Editing by W Simon)
By Pablo Garibian and Krista Hughes