Francesco Bagnaia claimed pole for the season-ending Solidarity Grand Prix, intensifying pressure on leader Jorge Martin.