That's assuming no gerrymandering and funny business at the polls.
>gerrymandering
I don't know the specifics of Brazil's system, but at least in the US gerrymandering has nothing to do with the Presidency or Senate, only the House. It's also not without risk. Gerrymandering is bad, but it doesn't change the totals of votes; it attempts to reapportion "excess" votes yielding a large win margin in one area to give winning, but necessarily smaller, margins in more areas. Amongst other challenges though that smaller margin means if there is a wave then a gerrymander can turn into a "dummymander" where previously safe districts get flipped.
>funny business
This is actually pretty dang hard in anything but a total sham, and even then is at least obvious it happened. Some timy fiddling at the margins may be possible to sneak through, and yeah some elections that might make the difference. But that can't counter any serious victory. The more common technique seems to be trying to suppress the vote. But as well as also not being trivial it also too risks backfiring by motivating people much harder. There is a lot of human psychology around "loss", people often absolutely hate things being taken from them even if they were complacent about having them.
Gerrymandering doesn’t change the fact that the voters decide the results. Most electoral systems already give unequal weight to different votes based on district sizes etc., so gerrymandering is only a change of degree and intention, not of how democracy fundamentally works.
gerrymandering is not possible with Brasil electoral system