I don't mean to insult Rio or anything, but I disagree with you about Rio being the best choice in Brazil (BTW, I am Brazilian myself). I think plenty of other cities would be a better place to host the Olympics than Rio, mainly because of the security and infrastructure. Belo Horizonte and Curitiba being the best choices both for their cities. Belo Horizonte is nicer as a city than Rio both in infrastructure and in sights (not everybody thinks beaches are the nicest views in the planet, mountains and historic cities are just as nice if you ask me). And Curitiba is by far safer and with better infrastructure (and has very nice views).
As far as beaches go in Brazil, the Northeast (Salvador, Recife) of the country beats Rio hands down. So, from both a subjective (beauty) and an objective (security and infrastructure) point of view, Rio was a very bad choice.
In the end, Rio won because the other countries were not acceptable to many people in the IOC. Almost everybody in Asia hates Japan, so Tokyo was out. Since the next Olympics will be in London, Madrid was out for being in Europe. And also as everybody mentioned in this post about Chicago, but missed one thing, (and I'm being objective here), there is still a very strong anti-Americanism in the world that lingers even after Obama was elected, so this pretty much eliminated the US location.
You might argue that because Rio is in total chaos as far as security goes, the money influx from the Olympics would be welcome. But this is missing a *very* important point. Economically, Rio is probably the second largest state in the country, as attested by the budgets of their state agencies,, so it was never a matter of lack of funds for Rio to fix itself. What needs to change is the politicians (in the whole country as a matter of fact, this is an acute problem in the country nationwide, but worse in Rio, Sao Paulo and the Northeast), which will not change because of the Olympics.
Moreover, is the world cup after Africa not going to be in Brazil? And will Rio probably not be one of the main venues? So in the end Rio did not really "win". It as a process of elimination.