Coal indeed is needed to build railroads in the game. Unfortunately railroads in Civ 6 don't amount to much other than the most advanced form of roads, and only buildable by military engineers, so that also is never used much in the game.
If we want to get pedantic (What, moi?) the required Resource for Railroads should be Money in vast quantities. It was the required amounts for building railroads that really drove the growth of financial markets and exchanges in the mid-19th century that was the financial equivalent and part of the Industrial Revolution. You could legitimately say that you cannot build a railroad unless you have at least one functioning Stock Market.
As to what Unit can build a railroad, while military engineers were certainly involved in every country (West Point, the US military academy, trained its graduates extensively as military and civil engineers, so almost every major railroad in the USA was either surveyed or built under their supervision), the construction was done by specialized 'navvys' or work crews, and their expertise was in such demand that British crews were exported to build railroads all over Asia, Africa and South America.
That points to a potential specialized 'Railroad Builder' Unit, possibly a form of Military Engineer or only buildable at a ratio of one for each Military Engineer you've already built.
Then each tile of railroad would require not only Steel, but also a certain quantity of Gold/Money and a specialized Unit to construct.
The other side of those extra requirements to get Railroads would be Game Changing Results
from railroads, which haven't been in the game so far.
Things like:
* All cities connected by railroad share Resources: the Food required by the population in one city can come from any City Radius in the group. Some percentage of the Production and Science Points generated by all the cities is shared among them as well, so that your raw new city on the frontier gets Production bonuses from the Factories, Workshops, Mills, or Resources in cities 30 tiles away as long as you have a working Railroad between them.
* All Amenities are now shared among all the cities: a Wonder in one city also extends most of its benefits to the other cities, because people can travel to visit and be influenced by the Wonder in a matter of days or hours, not weeks or months.
* All Population Points in all the connected cities can shift instantly from one city to the other: build a new Factory in one city, and Specialists/Workers can come from any of the cities to 'staff' it.
* Movement of any Unit between any points on a connected Railroad is Instant, requiring at most a single Movement Point to Load and/or Unload.
Add even a few of those effects, and the massive change in human activity produced IRL by the railroads would start to be reflected in t he game, and building railroads would assume the importance it should have.