It''s probably safe to assume that the AI system is basically unmaintained at this point
In fact, here are Durk's own thoughts about the status of the AI traffic system and restarting a more generic and more decoupled module instead:
https://wiki.flightgear.org/FGTrafficRegardless of limitations in the AI/C++ code, you probably can get quite a bit done using just Nasal and property rules in conjunction with LOD/effects
Assuming you have access to railroad network info (OSM?), it should not be that difficult to load that into fgfs and move some 3D objects around using these networks.
For the visualization part of everything, you'd want to look at LOD + effects/shaders.
If you also need terrain interaction, you'd want to code up a pseudo "train" FDM to account for "steepness" of terrain.
If you also need sound, you'd want to use a LOD scheme for that, too.
A number of folks have previously done work related to this - so there's tons of existing work to be looked at/borrowed from, it just isn't well integrated at this point.
Here's the ground services addon that could probably be adapted to load train/road networks into fgfs to monitor different networks/trains at the same time:
https://wiki.flightgear.org/Ground_ServicesIt might make sense to come up with a dedicated "TrainZZZ" addon and then simply take it from there, to see how far you get.
Once there is some traction, C++ folks are obviously going to get involved to help optimize any bottlenecks
A number of folks have used this approach previously - for instance, the Advanced Weather system came to be like that.
Then again, if you know C++ and are familiar with the SG/FG code bases, you could just as well review/improve the AI subsystem, which would probably be less work in comparison - but see the FGTraffic article to learn more about the architectural issues of that approach before doing any work in that area.
https://wiki.flightgear.org/Traffic_Shader