He got on the train.
Does 汽車 differ from 電車 in that the former refers to an older train, perhaps a steam train? I recall in another post, MsFixer stated that 列車 refers to a rather old train, and is not much used in modern days, while 電車 refers to more modern trains.
It’s good to know that you still remember my previous answer to the question about the difference between 電車 and 列車.
汽車 sounds “more” old-fashioned than 列車. Only old people living in some rural areas still say 汽車 these days. So, I would suggest Clozemaster to replace 彼は汽車に乗った with 彼は電車に乗った unless the sentence is used in a historical movie/TV drama.
汽車 includes all “non-electric” trains. It could be a steam train or a diesel-powered train etc.
Some rural areas don’t or didn’t electify until recently due to less passengers (and thereby lack of investment). The average distance between two stations in such rural areas is very long, and the major trains in these areas are long-distance passenger ones like the Orient Express in Europe. As a result, the local people in such rural areas also call (or called) any long-distance passenger trains as 汽車 - whatever the engine is. You can regard this usage as a dialect or a rare case. Japanese people living in urban areas don’t say 汽車 at all when they refer to long-distance passenger trains.