Unfortunately, grade crossing accident's are probably not going to go away all together, although there are some steps that can be taken to reduce their number.
It is impractical due to the huge cost, to eliminate all grade crossing's. They can eliminate some, and better protect other's. Such as full-width barrier's, that would prevent the foolish motorists that try to 'slalom' around the half-crossing's.
I am not sure if the PTC system will be able to monitor crossings, that may have vehicles stuck, blocking them, or not. If not, perhaps such sensor's could be added to the system.
Probably one of the best fixes, would be to really elevate the education of motorists, as to the risk involved. "Operation Lifesaver",
https://oli.org, should receive more funding, so that all new driver's receive more information. I have not heard much from this program in recent years, at least where I live, probably because there are fewer grade crossings...