I guess the consensus is that the truck driver is at fault. But we have to design our world to accommodate stupidity and accidents and try to minimize the damages that occur, with cost-effective measures.
My impression is that Southern California has initiated limited commuter rail passenger services on existing freight lines with limited resources for infrastructure improvements like grade crossing separation.
On these passenger carrying lines, maybe it's time for some advanced technology that can detect whether a grade crossing is physically cleared of vehicles and obstructions and the train gets a signal accordingly - so it might get some advance indication of a need to try to stop without relying entirely on what the crew can see from the cab.
Possibly there could be a readout to motor vehicles that a train is expected in so many minutes at a grade crossing. It might make people more aware of how often to expect trains.
Old-style "level crossing" barriers in England provided complete obstruction of the railway right-of-way when opened for road traffic, so that vehicles couldn't possibly drive on the tracks. And the barriers wouldn't be able to move into the closed-to-vehicles position if a vehicle was on the grade crossing. A track signal could be linked to that for advance warning to trains.
Just brainstorming.