Lula wins a ‘miracle’ election in Brazil. Now comes the hard part: putting the country back on the right track