OFFICIALS from Brazil and Mexico are arguing over the future of a 2002 agreement that allows free trade in cars between them. For a decade it worked as it was meant to, and to Brazil's advantage, by encouraging carmakers in Mexico to specialise in larger models and those in Brazil to make smaller ones. But last year Mexican exports under the accord grew by 40% to $2 billion, while Brazil exported cars worth just $372m. Brazil has cried foul. This apparently petty dispute says much about how Latin America's two biggest economies think about trade and industry.

By throwing open its market under the North American Free-Trade Agreement (NAFTA) with the United States and Canada and a host of other bilateral trade accords, Mexico has become a base from which carmakers export to both halves of the Americas, and worldwide. Volkswagen, for example, makes all its Beetles and Jettas there. Although Nissan produces some vehicles at a Renault plant in Brazil, most of those it sells in Latin America come from two plants in Mexico. In all, 2.1m of the 2.6m vehicles produced in Mexico last year were exported.

By contrast, in Brazil the main aim of public policy has been to push carmakers to build local factories from which to supply the country's huge domestic market. Only 540,000 of the 3.4m vehicles manufactured in the country last year were exported. Around three-quarters of Brazil's car exports go to Argentina. Mercosur, to which both countries belong, has long aspired roughly to balance trade in cars and car parts between the two.

The Brazilians have become worried about a surge of imports that has come about partly because of the strength of the real (which has risen by 32% against the dollar since the start of 2009). Car imports grew by 30% in 2011 (and those from China by ten times as much). In December the government slapped a punitive tax increase of 30 percentage points on imports of cars whose makers lack a factory in Mercosur or Mexico. Officials then cast a tremulous eye at the accord with Mexico, which they think has become a conduit for the import to Brazil of cars largely made at the East Asian plants of global carmakers, such as VW and General Motors.

Brazil now wants to change the agreement in three ways. First, it wants cars benefiting from it to have at least 40% local content. It complains that Mexico fails to enforce the current requirement for 30% local content. That is something strongly denied by Bruno Ferrari, Mexico's aptly named economy minister. In any event, Mexico sees its car industry as part of a global supply chain. It is hard for it to raise local-content requirements quickly, since that would change the basis on which companies invested. In Brazil, by contrast, carmaking has long been an integrated industry, with high local content.

Second, Brazil wants to extend the agreement to trucks and buses, in which it reckons it is competitive. Mexico is “not afraid of doing that”, says Mr Ferrari, but only “with reciprocity”. At the moment, Brazil builds engines to European Union emissions standards, whereas Mexico uses both the EU standards and the United States' different (though no less strict) ones. But whereas Mexico accepts imports of both types of engines, Brazil accepts only the EU type. Mexico wants that to change.

Third, Brazil wants to limit tariff-free imports by a quota similar to the one imposed on car trade in Mercosur in response to surges in imports. “I would rather discuss how to increase our trade than how to decrease it,” says Mr Ferrari. Brazilian officials are making no public comment.

Mexico's stance reflects the openness of its economy, at least to trade in goods (many service businesses in the country are in the hands of cosseted cartels). Its average tariff, weighted by the composition of imports, is 5.56%, compared with Brazil's 10.47%, according to the World Trade Organisation. In 2010 almost two-thirds of its imports entered free of duty, compared with just over a quarter in Brazil.

Mexico suffered a big shake-out of its industry when NAFTA came into effect in 1994. A decade ago it saw several hundred thousand jobs in assembly plants go to China. But openness to global competition has made Mexico's surviving industries highly efficient. Industrial production has grown again in the past two years. Manufacturing's share of GDP has remained steady at between 17% and 18% since 2003.

In contrast, Brazil's government sees the country's domestic market as an asset to be protected. And it sees imports from China, made even cheaper by the strength of the real, as a threat to its industry. “The regional economy has been threatened by predatory competition that has taken hold around the globe,” said Fernando Pimentel, the industry minister, last year. “Developed countries are those that have industry and we're going to protect our own.”

Yet Brazil's growing protectionism risks locking in high costs. The country has “a competitiveness problem, not a trade problem,” says Ricardo Mendes of Prospectiva, a consultancy in São Paulo. Manufacturing's share of GDP has fallen from 17.2% in 2000 to 14.6% in 2011. Falling industrial production was one reason Brazil's economy grew by just 2.7% last year. The blame lies mainly with high interest rates and other domestic burdens.

Mercosur was supposed to provide a bigger market for Brazilian industry. But Brazil is now locked in a series of trade spats with Argentina, which is even more protectionist. Débora Giorgi, Argentina's industry minister, and Guido Mantega, Brazil's finance minister, recently suggested that Mercosur should raise its common external tariff. That will not go down well with Uruguay and Paraguay, the group's smaller members. But even if it did, it looks like a recipe for industrial decline.