Minecraft with the Create mod lets you make factories and coordinate logistics to move materials from one to another with a rail network, and you can build the trains yourself block by block (including steam whistles)! It's the most immersive train game IMO because you get to set up ever little detail, every signal every junction up to your needs.
Haha I remember I once streamed a base showcase to my friends and when I had to explain that the power generation for my world eating quarry came from an array of magical bees hooked up to machines that would harvest their honey, I can now never escape the capitalist allegations.
There are a variety of minecraft rail mods. I really like railcraft as it lets you build your own train hold/waiting logic. Some others are immersive railroading and maincraft transit railway.
I'm glad to see someone else thought to mention the Create mod when faced with this question, however, one must also mention the addon mod Create: Interactive, it would in theory allow you to create a self-perpetuating giant train base that drills its path forward, creates more rail in a built in production line with the drilled stone and deploys it automatically. Let's not forget the one addon specifically made to expand the train system as well.