Dani Pedrosa defeated MotoGP title rival Jorge Lorenzo in a fantastic last-lap duel at Brno.