Crossing gate also has (5) wires. Black and Red are power to the crossing gate. Blue, Yellow and White are the control wires.
Red center rail, power, Black outside rail common.
Touch the Blue and Yellow together, the gate should go down, lights flashing, and stay down.
Touch Blue and White together, the gate should go up, lights stop flashing, and stay up.
Dwarf light: Red and Black, power to the dwarf light. Blue would be common.
Blue connected to white would probably be the green light.
Blue connected to yellow probably the red light.
The Dwarf light will require some type of relay, at the least, a normally closed NC normally open NO switch. NC/NO. (Three wires)
Note the instructions on the crossing gate.