Railroads use a sealed beam par lamp that's held into the mounting assembly by a bezel that is hinged to open and close. Two wires must be attached to the back of the par lamp using screws. A railroader can change one of these en route without any trouble if there is a spare on board the locomotive. Some railroads routinely keep spares on board. Others don't.
Fancy lamps such as are used on cars are expensive and their durability under the abuse they take in railroad service is unproven. Incandescent par lamps are reasonably inexpensive and have proven to be durable. When the standard headlight was a glass reflector with a screw-in bulb, there were special headlight bulbs that were extra durable.
All railroad headlights use 74v direct current. Therefore they are not compatible with any automotive lamps.