From the Super Mario Wiki
The Yoshi Train is a form a Yoshi can transform into in Super Mario World 2: Yoshi's Island by touching a Morph Bubble containing its picture.
This form allows the Yoshis to move along rails that can be seen on walls in the background. To start moving on the rails, the player has to stand in front of them and press "up" on the D-pad. The Yoshi Train can be controlled with the D-pad and sped up by holding the button or the button on the controller. While moving on rails, Train Bandits, Shy Guy-like enemies apparently painted on the walls, come to life to attack the train, making the player briefly lose control of it when they touch it.
In Mario Kart: Double Dash!!, the Yoshi Train appears in the background in Baby Park, at some point going right over the track damaging any kart that makes contact (except in Time Trials mode). It also makes an appearance in Mario Super Sluggers on the Yoshi Park field during the day. At night, it is replaced by a Wiggler Train.
Unlike most of Yoshi's other transformations, the Yoshi Train does not reappear in Yoshi's Island DS.
Names in other languages
||From Lokomotive (locomotive)