Group of 20 Meets in a Mexico Outperforming Brazil Sam Hodgson/Bloomberg News Travelers in Mexico City last month. On Monday, leaders from the Group of 20 nations will gather in Mexico, whose economy is growing faster than that of Brazil, its more widely admired rival. MEXICO CITY - Mexicans looked on with envy in recent years as Brazilians won a reputation as Latin America's chosen people. With a surging economy and a prominent place on the world stage, Brazil was the country poised for greatness while Mexico remained mired in bloodshed and destitution. But just as momentum can change suddenly in a match at the World Cup or an event at the Olympics - both competitions that Brazil will host in the next four years - so can the dynamics between nations. Last year, Mexico's economy grew faster than Brazil's, and it looks set to outpace its larger Latin rival again in 2012. Brazil's slowdown can be attributed partly to debt-burdened consumers and the erosion of industrial production, which is tied to the recent strength of Brazil's currency, the real. On top of that, slowing global growth, particularly in China, has pushed down prices of the commodities that Brazil exports. Meanwhile, Mexican factories are exporting record quantities of televisions, cars, computers and appliances, replacing some Chinese imports in the United States and fueling a modest expansion. Economically, Mexico does not appear as grim a place anymore. "The best way to improve your image is G.D.P. growth," said Luis de la Calle, a former Mexican trade negotiator and an economic analyst here. Mexico's strengthening economy underlies the glossy veneer on display as President Felipe Calderón hosts the Group of 20 leaders of major industrialized and emerging economies at the luxury beach resort of Los Cabos on Monday and Tuesday. In contrast to the widening crisis in the euro zone, which will be the focus of the talks, Mexico will be able to point to 17 years of macroeconomic stability, low inflation, manageable debt, an open economy and increasing competitiveness. The gross domestic product expanded 3.9 percent last year, ahead of Brazil's growth of 2.7 percent. And there are encouraging signs for the years ahead. Nissan, Mazda and Honda all announced that they would build new plants in Mexico, and new investments in aerospace and electronics are also on the horizon. "Stars appear to be increasingly aligned for an economic outperformance" by Mexico, a report in May from Nomura Securities concluded. A changing of the guard is slowly but surely taking place. The reversed fortunes of Latin America's two largest economies are a sharp contrast to the euphoria over Brazil's prospects as recently as 2010, when the economy grew 7.5 percent in the last year of President Luiz Inácio Lula da Silva's government. "The years of good growth are clearly in the past," said Antony Mueller, a professor of economics at the Federal University of Sergipe in Brazil. In one sign of unease, the Brazilian government threatened this year to cancel a 10-year-old automotive trade accord with Mexico. For most of the pact's life, Brazil had sent more cars to Mexico, but last year that reversed, with imports of Mexican-made cars surging 70 percent to $2.4 billion. In March, Mexico agreed to cut its exports to Brazil to an average of $1.55 billion annually for the next three years and restore free trade after that. The dispute highlights each country's distinct approach to development. Mexico has been dedicated to open markets, free trade and deregulation. Brazil's model involves muscular government intervention through big state-controlled companies. At the same time, China's rise has affected Brazil and Mexico in opposite ways: China competes with Mexico and buys from Brazil. Mexico struggled for much of the past decade as Chinese-made products replaced Mexican goods in the United States, which buys 78 percent of Mexico's exports. And China's demand for raw materials helped lift Brazil's economy as stability allowed the government to redistribute the wealth and expand credit. "Brazil has had two powerful narratives," said Gray Newman, an economist for Latin America at Morgan Stanley. If you believe in China, you believe in Brazil. That counted for a lot. The second narrative is that "We've become a normal country and created the conditions for the emergence of a middle class." Those narratives are so powerful. Mexico's story has not been as positive, Mr. Newman said, with its fortunes tied to the United States and the government engaged in a war against powerful drug gangs. Even with the tide turning in their favor, Mexicans are so gloomy they do not see it, analysts say. Elisabeth Malkin reported from Mexico City, and Simon Romero from Rio de Janeiro.