Using pak128, I found that a road can cross a railroad track at grade only on the surface, and only if the road has a speed <= 90 km/hr, and the railroad track has a speed <= 160 km/hr. I don't object to this, high-speed crossings at grade seem rather dangerous, though it does seem a bit odd that this only applies to crossings between different way-types. Two 200km/hr roads, or two 400 km/hour railroad tracks, can cross at grade without any problems.
What I was wondering is, what controls this? Is it built into the game engine? Is it determined by some aspect of the *.dat files?
The dat files have a crossing speed. Crossings exceeding this are not allowed.
For pak128 see https://github.com/simutrans/pak128/blob/master/infrastructure/road_rail_crossings/RoadTrackCrossing.dat