The plot device of performers traveling via rail and enduring sleeping hardships was previously used by Laurel and Hardy in 1929's Berth Marks.
In the context of comedy films, the plot device of actors enduring hardships while traveling by train was first employed by Laurel and Hardy in their 1929 movie Berth Marks.