Spain’s Jorge Lorenzo overtook his compatriot Dani Pedrosa on the final lap to win the Spanish MotoGP on Sunday.