When your laying tracks in a hurry, a good trick is to build a city on the bad terrain. It may not be a "good" city, but it is an instant RR on a hill, forest, swamp/jungle or mountain hex. If you do not have a road in the bad stuff, beforehand, there is no way to avoid the one turn delay, but by building a city you can avoid the wasted engineer time in building a RR.
By the time you reach RR and explosives, you should have enough cities to support 30+ engineers. Even in democracy, most cities can support one engineer. The engineer is the unit that provides the "glue" that holds your empire together. It is the source of new cities, creates the roads and RRs that link your cities together, and improves terrain to maximize resource production.