This grade crossing problem has been a long time in the making. It seems to be a problem without a solution, except for the elimination of grade crossings.
The best analysis that I have ever seen on the subject is from a book,
The Metropolitan Corridor by John R. Stilgoe; Chapter 6.
CROSSING.
He explores some of the deepest levels of the problem since its beginning. This is one of the oddest facets of the problem:
There was an era when people set their clocks by the trains. The precision and timing of trains and their institution seemed like a timepiece in itself—or a master clock one might call it. Many of these people setting their clocks by the trains also lived near the railroad and likely crossed the tracks frequently. They certainly knew the danger of being struck by trains, but they also believed in the precision of train time. So they would always look for trains if they needed to cross during train time. By the same token, they paid less attention when no trains were due.
So one of the strangest consequences of trains getting off-schedule was that they tended to hit more crossers.