I N COSTA RICA’S rainy season, bright mornings yield with deceptive suddenness to tropical downpours. So it was on September 10th, when the country’s civil servants went on strike. They oppose a fiscal reform that raises some taxes and limits automatic wage increases. Universities and public offices were deserted. After blocking roads and a railway, many went home before the afternoon shower. Two months later, some are back at work. But teachers are still on strike and many state schools remain shut. With reform stalled, the currency is under pressure and investors have pushed up the cost of servicing the public debt. Unless Carlos Alvarado, a social democrat elected as president in April, wins this trial of strength, Costa Rica may follow Argentina into the arms of the IMF .

This is in a country that, like its weather, in many ways sparkles. Its long-established democracy and new industries, such as ecotourism and medical instruments, make it a model for Latin America. But its fiscal clouds may represent the region’s future, too. Costa Rica spends badly. And it finds it hard to raise the taxes necessary to pay its bills. The fiscal deficit stands at 7% of GDP . Past governments ramped up public employment. Costa Rican civil servants are unusually well rewarded. The public wage bill is 12% of GDP . That is above the Latin American average of 8.4%, which is itself high by international standards, according to data from the Inter-American Development Bank ( IDB ).

The question at stake in Costa Rica is a crucial one for Latin America: is the main purpose of the state to benefit citizens, or its own workers? This matters because, although there are big variations, on average public spending rose sharply in the region in this century, partly because of the (temporary) extra revenues furnished by the commodity boom. The days of easy public money are now over. Faced with more demanding electorates, which want better public services, governments must learn both to spend more efficiently and to change their priorities.

There is scope to do so, as the IDB argues in a recent report (“Better spending for better lives”). Its authors say that, on average, 16% of government spending (or 4.4% of GDP ) in Latin America is wasted. The reasons include inefficiency or corruption in procurement, as well as paying low-ranking civil servants more than private-sector workers in similar jobs.

Spending on payrolls and pensions squeezes out public investment, especially in the region’s missing or crumbling transport infrastructure. Big pension outlays discriminate against the young. On average, governments spend $4,000 a year per person on people who are over 65 and $1,500 on under-tens. Brazil, a country crying out for better health care and policing, spends half of the federal budget on pensions. “The bottleneck for our development is the inefficiency of the state and its costs,” says Ottón Solís, an adviser to Mr Alvarado in Costa Rica.

Behind every inefficiency are beneficiaries who tend to be organised, while losers are not. That is Mr Alvarado’s battle in Costa Rica. His fiscal reform is modest. It might reduce the deficit slightly, by 1.5% of GDP , mostly by replacing a sales tax with a value-added tax, which would apply to staple items and to untaxed services, such as university education. It would also curb some civil servants’ entitlements. That is what has riled the trade unions.

They say the government should fight against tax evasion instead (it should, but that does not make the reforms unnecessary). They present the strike not as a defence of their privileges but as a fight against the value-added tax, which will hurt ordinary Costa Ricans. (In fact, the tax on staple items is just 2%, and will help in combating evasion.) The unions have appealed to the supreme court’s constitutional chamber, which must rule by November 26th on whether the reform requires a two-thirds majority in congress. The judges benefit from the status quo, so the government may have to round up the extra votes. It probably can, but that is no certainty.

Latin American leaders will have to fight similar battles on equally pressing issues, for example boosting the region’s lacklustre productivity. That will require reforming archaic labour laws.

To tackle vested interests political leaders require “moral authority”, argues Mr Solís. Mr Alvarado probably still has that. But most of Latin America’s other democratic politicians have rarely been less trusted than today. Better states require better-regarded politicians. That is the really hard part.