As gpsoft mentioned, I created
the patch "safer level crossings", where trains stop for vehicles, if the crossing is not cleared. Although it makes level crossings 100% safe for vehicles, I gave up on this idea, because trains just shouldn't stop for vehicles. Imagine a jam on a crossing, this would make the train stop forever.
Reserving the level crossing earlier is a first step into the right direction. But in case of a road vehicle jam, thats worth nothing.
Thats where road vehicles need to be a little more intelligent. They need to obey the rule "
only cross level crossings if I can safely reach the other side". This picture should explain what I have in mind. I assume 2 vehicles may queue up on one tile.

- intelligent vehicles at level crossings.png (5.57 KiB) Viewed 2927 times
a) There are two level crossings ahead the red RV. The red RV needs to decide: drive or stop? Along its planed path, it checks 1) how much level crossings there are, 2) how much vehicles there are on the same lane, 3) how much space is behind the level crossings. In this case, there is 1 vehicle on 2 level crossings. The yellow tile is free, which means there is enough space for the blue and the red vehicle. Red vehicle starts crossing.
b) Same situation, 2 more vehicles on the road. Note: there is not enough space on the orange tile for RV 1,2 and the red one. If this is the case, the red RV checks the next tile along its planed path. 1 more vehicle. Now there is enough space behind the level crossings: 4 RV on 2 tiles.
Its up to design, how many tiles behind the level crossings will be checked at most. I suggest to limit the tiles to be checked behind the crossings to the number crossing tiles. In case b) a 4th vehicle on the level crossing would cause the red RV to stop.
A similar patch to this already exists:
http://www.tt-forums.net/viewtopic.php?f=33&t=27184
Bilbo wrote:So maybe we can forbid level crossings for maglev and monorail (way too high speed for crossings of any kind - in real life these technologies don't use the crossings) ...
I like this idea. It makes level crossings safer and it adds an interesting difference between railway and monorail/maglev.
Furthermore, all adjacent level crossings next to a closed level crossing should close, too. Otherwise RV may queue up on level crossings.