Brazilian President Luiz Inácio Lula da Silva has won reelection, securing a historic fourth term after a dramatic comeback in the runoff.