Most of the simple analog locomotive use DC voltage with normal or reverse polarity, normal polarity go locomotive forward and reverse voltage go locomotive backward.
I used for test on breadboard a 5mm bicolour led (red/white) LTW30EEDYJA but for 3mm can be used OSRWPA3132A.
I designed a simple schematic with additional 3 pieces: 2 diodes (1N4007) and a resistor (680Ω..1kΩ):
For normal polarity for power supply of the analog locomotive white led is on
and for reverse polarity red led is on I make movie named automatic white/red light for loco with a 3 pins led: