"yet CR is clearly not as well off as a country as Mexico is", I'll have to disagree with this, even though Mexico is a bigger country in therms of economic and money ( just with the fact that they produce oil, wich would give CR way too much resources to develop it self in many fields) stadistics clearly show they have higher numbers in poverty, crime, N.R contamination, etc.
The key here is that the few income resourses the state obtains are well invested within the country in all the fields, instead of spending them in a big military budget such as most of the latin american countries does.