Steel rails we not made in the US until May of 1865, so not until nearly the end of the Civil War. In the 1860s Bessemer steel production required unusually high quality iron ore. This type of iron ore was coming from some Michigan iron mines and the Eureka Iron Works was established in Wyandotte Michigan (near Detroit) in 1857. In 1865 Eureka Iron Works steel was sent to North Chicago Rolling Mill where it was turned into steel rails.
At the time Michigan was harvesting large quantities of low cost hard wood needed and mining unusually high quality iron ore. Once you add in the inexpensive water transportation from the iron mines and timber areas, and the water movement of the steel to Chicago lowed the cost of making steel Detroit. This allowed the production of of steel and shipping that steel by boat to Chicago available at a price that allowed iron rails to be made.