Martinelli’s last-gasp goal takes Brazil past Japan into the pre-quarterfinals