What is the best way and the most effective way to lay train tracks on a uneven terrain

So I am trying to make very large desert map with train tracks all around it, I successfully made the map using height map but I don’t know how to lay train tracks on it because the terrain are very uneven, I could just use the smooth tools or the erode tool to smooth the way out but that would take sometimes so I want to find other ways to do it that would be more effective than this. If you know any other ways please suggest. I would be very appreciated.

There are many plugins like road plugin.