Jorge Lorenzo is on pole for Sunday's Japanese Grand Prix at Motegi after securing a track record late in the final qualifying session.