I assure you that if you jump in front of a moving train you will be killed. How is this different?
road usage is shared among cars, motorcycles and scooters, trucks, pedestrians, bicycles, mobility scooters, and other things.
Also, trains don't change lanes, or stop quickly. Its simply a bad analogy.
Cars (at lease autonomous ones) signal before changing lanes and slowing down.
I think that flashing lights is too annoying, but forcing cars that drive in the night to have lights sounds like a reasonable (and existent) rule.