* Lula did something unusual, which is win in the second round after trailing in the first. This is a first in Brazilian politics, so simple pattern matchers are surprised.
* Turnout. Made all the difference.
I'm not surprised. If you have one terrible candidate, in the first round you can vote for whomever you like. In the second round, however, you need to ensure they lose, so you vote for the opposite party, whomever they might be.
There were 10 presidential elections in Brazil after the post-1988 constitutional system, with 2 of those decided in the first round.
8 is a really small sample to consider it as unusual, plus the reversal was not that huge 1.8%