While offering obligatory (Fard) or voluntary (Nafl) prayers in vehicles like trains, boats, ships, and airplanes, it is necessary to face the Qibla. Some unaware people, without any valid excuse, pray during journeys on trains, etc., wherever they want according to their convenience without regarding the Qibla; this is not permissible. (Book: Kitab-un-Nawazil / Vol: 3 / Pg: 440)