How come Brazil and Mexico aren't superpowers, but Russia is?

Just you wait - Brazil as a superpower is coming,

Your assumption is that the decisions made by Pakistan, Saudi Arabia and South Africa in this regard were rational and beneficial. That’s questionable, to put it no higher.

Maybe they figure that maintaining good relations with their neighbours is a cheaper and more effective strategy than spending billions on a bunch of phallic symbols?

Your greatest geopolitical opponent has nukes. Not getting them is irrational.
The Brazilians face a mostly benign external security environment while Mexico is in essence a US client state, where a nuclear programme will see the wrath of Uncle Sam visited upon the country.
Bit different no?

To expand on this, see the South American dreadnought race; Brazil sought what were the most cutting-edge high-tech weapons of the day, touching off a naval arms race with Argentina and Chile. Note also that the Brazilian Navy continued to operate aircraft carriers until well into the 21st century (and probably not a coincidence that Argentina had an aircraft carrier until the end of the 20th century).

And as others have commented on the idea of a country’s “neighborhood”: Russia was right in there with Prussia (later Germany), the Austrian Empire/Austria-Hungary, and the Ottoman Empire (not to mention such former great powers as Sweden and Poland); and eventually wound up bumping up against China and the frontiers of the British Empire.

Brazil, as noted, has historically sought a considerably greater military role than has Mexico; in terms of its “neighborhood”, Brazil is next to Argentina, and not far (at least in a naval sense) from Chile–two other countries with aspirations for at least regional or middle power status. South America has definitely not been free of inter-state wars: the various Platine Wars (already mentioned), one in 1828-29 between Gran Colombia and Peru; a complicated sounding one involving Peru-Bolivia, Chile, and Argentina from 1836-1839; the aforementioned very bloody Paraguayan War of 1864 to 1870; the War of the Pacific in 1879 to 1884 (in which Bolivia lost its coastline); and the brutal Chaco War of 1932 to 1935 between Bolivia and Paraguay. Of course, Brazil wasn’t involved in all of those, but the point is, it was that kind of neighborhood. There were also a substantial number of disputed South American borders well into the 20th century, including several to which Brazil was a party.

By contrast, with Mexico I think it did become clear pretty early on that Mexico was never going to be a serious military rival to the United States; and contrarily, Guatemala and so forth were never going to be a serious military rival to Mexico. So, no Mexican dreadnought battleships or Mexican aircraft carriers or anything like that. What would be the point?

Without invoking the pejorative label ‘client state’ label in either case, why isn’t the US the ‘greatest geopolitical opponent’ of Mexico? Because Mexico realistically gave up long ago thinking of the US that way, though at one time it did. One might argue the real difference is that Pakistan hasn’t given up an unrealistic view of itself as any kind of peer to India. Or else one might argue the US is more to be trusted than India as a neighbor with overwhelming military superiority. Although I know that would be problematic for a lot of people if it carried any positive implication about the US. The argument would probably be made by exaggerating how bad a neighbor India would be or is (say to Bangladesh) if Pakistan focused on developing instead, and removed the threat not only to the world in general but to Pakistan itself of mixing nukes with Pakistan’s degree of societal and political instability.

I wish more countries would consider this effective strategy. The world would be a better place.

This is why i think Trump is trying to cozy up with Putin. It seems a good strategy to bring Russia back into the western world economics. It might require some biting of the tongue but in the long run I think it is doable.

Soccer.

Trump’s relationship with Putin is more like a customer and a bank.

Brazil in fact had a nuclear program but they abandoned it, I think around the time of the end of the cold war.

Certainly, every US administration since the fall of the Soviet Union has pursued good relations with Russia for this reason.

There are grounds for optimism. The number of countries which could afford a nuclear weapons programme but choose not to have one vastly exceeds the number of countries which have one.