Fact is, there
are occupations that pay a nice salary in Brazil, even after conversion to US$, even with the current exchange. Brazil is not poor; lots of flashy cars on the streets, upscale bars and restaurants are shock full day after day.
But there is this deeply rooted notion that software engineers are not supposed to make as much a judge, a doctor or a higher-rank bureaucrat of the public sector. The current bewildering is more cultural than anything else.