All of the small miracles you listed happened in spite of the culture, not because of it. It's also not a coincidence that both are deeply linked to the most successful brazilian enterprise: the brazilian government.
I'm trying to avoid getting too deep in these Brazil tangents so I'm gonna leave it at that. Anyone who cares enough to know what I think about the subject can just look up my comment history.
Timothy Snyder, in On Tyranny, has a chapter about staying in touch with friends from other countries, and while we are not friends, this thread is in that spirit and I have learned things from you, so thank you!
A lot of AI researchers were just in Brazil due to ICLR. A number of them got robbed in broad daylight in this supposedly nice part of Rio. I think the assesment of Brazil is accurate.
To reduce a culture and country like this comes off as bigotry
In example, Brazil has the #3 airplane producer in the world
Or consider why the US is doing all it can to prevent their payment system from becoming widely used?
I was intentional about putting the perspective in the future over today as the poles of the world are evolving