James Hinchcliffe overtook Takuma Sato on the final turn of the final lap to win IndyCar's Sao Paulo 300.