A dashboard camera in Ukraine recorded the moment an SUV trapped between railroad gates came within seconds of being struck by a train.

The dash cam footage, posted to YouTube by Viktor Kohut, shows the SUV trapped between the lowered gates at a railroad crossing in Boyarka, in the Kiev region.

The vehicle appears unable to move forward or backward due to the lowered gates, but a man in an orange vest runs to the rescue and lifts one of the gate arms to allow the SUV to drive off the tracks.

A train comes speeding through just seconds after the vehicle clears the tracks.

Kohut branded the driver a "brave moron on the move."