The two emerging market currencies usually move in tandem with each other, but foreign trade spats, domestic politics and economic data have driven them apart lately.
Many in the market are betting they will snap back in line, but some suggest an underlying shift in investor views.
U.S. President Donald Trump's threat on May 30 to slap tariffs on Mexico may have tipped the balance for money managers to reduce the Mexican exposure in their Latin America funds, according to Standard Chartered senior strategist Ilya Gofshteyn.
"While we expect some short-term recovery in Mexican risk assets, we believe that this episode has injected a more permanent risk premium into holding Mexican assets," he told clients in a note.
"We believe investors may rotate out of the Mexican peso and into the Brazilian real as a result."
The peso has been hit hard by a credit-rating downgrade in addition to U.S. trade tensions, while the real has rebounded from an eight-month low on hopes that Brazil's government can pass an ambitious pension reform bill through Congress.
The peso fell as much as 5% in the last few weeks - it has since regained most of that ground since Trump said last Friday a deal had been struck with Mexico, although he has since revived the threat if Mexico cannot meet his demands - while Brazil's real strengthened some 6% in the last three weeks.
The following charts show the extent to which traders have been laying opposite bets on the two currencies.
The first two show the simple 30-day correlation between the dollar/peso and dollar/real exchange rates, one overlayed with Brazil's exchange rate and the other with Mexico's. The correlation, almost always positive, has turned negative.
GRAPHIC: Brazil-Mexico FX correlation - BRL -
GRAPHIC: Brazil-Mexico FX Correlation - MXN -https://tmsnrt.rs/2IfYbfV
Since their respective crises and devaluations in the mid- to late 1990s, the peso and real have almost always been positively correlated, rising or falling together.
The average correlation was +0.5 over the last five years, +0.52 over the last decade and +0.48 over the last 20 years.
A correlation of 1.0 is the strongest possible positive correlation, and -1.0 the strongest negative correlation. There have only been seven negative correlations in the past 20 years before the current one. All have lasted just days or weeks.
Four have marked the start of, or a reversal of, major trends for the real, sometimes lasting years. For example, after December 1999 the real embarked on a super-charged rally that took it above 4.00 per dollar in October 2002, while December 2015 marked the end of a similar surge lasting over four years.
Only one period of negative correlation between the two currencies has resulted in a similar move in the peso. That was in January 2017, when dollar/peso snapped back 20% over the following six months from its record high above 22.00.
Futures markets highlight the degree to which traders' views on the two currencies have diverged.
The chart below shows the difference between hedge fund and speculators' net peso and real positions on the U.S. futures markets. The Commodity Futures Trading Commission data reflect the speculative trading community's bias in any given asset.
GRAPHIC: Brazil-Mexico FX - CFTC futures -
Last month, traders were more bullish on the Mexican peso relative to the Brazilian real than at any time since CFTC futures contracts in the Brazilian real were launched in 2011. The gap between net long peso positions and net short real positions reached 174,00 contracts, CFTC data show.
That has since eased off by around 20,000 contracts, but it is too early to say if this is a turning point or not.
There are two schools of thought as to what happens next.
In the first, Brazil's pension reform process hits another hurdle as the economy tips into recession, killing the recent upturn in positive sentiment. Investors would then broadly avoid emerging markets as the U.S. economic slowdown takes hold, sending the real into the same doldrums as the Mexican peso.
In the second scenario, U.S.-Mexico relations sour and Trump makes good on his threat to slap hefty tariffs on imports from Mexico. At the same time, pension reform in Brazil passes, boosting growth and investor demand for Brazilian assets.
In that scenario, the divergence would continue, pushing the correlation between the two currencies even deeper into negative territory and the divergence in futures markets to new highs.
"If Brazil delivers, we will have a huge technical move with investors unwinding long dollar/Brazil positions," said one senior trader in Sao Paulo.
(Reporting by Jamie McGeever; Editing by Brad Haynes and Susan Thomas)
By Jamie McGeever