Japan took the lead in the first half but Casemiro equalised with a header and Gabriel Martinelli scored in stoppage time as Brazil won 2-1