Brazilian President Luiz Inácio Lula da Silva, once trailing challenger Flávio Bolsonaro in his re-election race, turned the contest around in three weeks.