you’d think there would be some avenue for emergency services to relay the message from the semi to the rail line to try to prevent this.
Probably not legal, but better than an accident. Laying a piece of metal across both rails or connecting them with a wire should send a signal that the track is potentially blocked, similar to the way a continually tester works.