Brazil leftist Lula wins third presidential term to redeem tarnished legacy