A wheel on a train as it rolls on the track produces 2 curves: regular cycloid, and prolate cycloid.
The regular cycloid is produced as usual by the rim of the wheel as it rotates along the track.
The prolate cycloid is produced because part of the wheel (the flange) extends beyond the circle that contacts the rail. This curve produces a loop below the rail at every revolution, thus part of the wheel (and part of the train) travels backwards. A point on the flange is further away from the center of the wheel.
A different curve is produced by the valve on a bicycle wheel, or an ant on one of the spokes. It is called a curtate cycloid. A point inside the circumference of the wheel is closer to the center of the wheel.
These are displayed in the illustrations by the green dot, which follows the pertinent curves in red.