Train tracks are also shared at train crossings. Yet if a car went there after the warning lights went on, the car would be to blame.
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.