Maulana Dawood Raz
Hadith Commentary:
It is understood that for obligatory prayer (fard salah), one would dismount from the animal, because it is not valid to perform it while mounted; there is consensus (ijma‘) of the scholars on this matter.
By "mount" (sawari), camels, horses, mules, etc. are meant.
Prayer performed on a train is valid.
Source: Sahih Bukhari: Commentary by Maulana Dawood Raz, Page: 1098