One dispute the South had with the North pre-war was the use of government money for infrastructure improvements -- canals, railroads, harbor improvements -- believing that it was not the government's responsibility to assist businesses this way. Once on their own, the South made good on that belief by refusing to allow such spending in the Confederacy. What little was spent by the government on railroads was always justified as a military necessity and the money was always provided as a loan to the company.
President Davis never took control of his cabinet in regard to the allocation of Confederate resources. Each Department could have what it could get Congress to authorize. With the success of the CSS Virginia, the Navy Department was able to force the main iron foundries to provide most of their rolling capacity to provide armor for more gunboats, leaving little space for railroads to get work done, including manufacturing and re-rolling of existing rails.
Both the War and Navy Departments forced the foundries to produce artillery tubes to the point that there was little iron left that could have been spent on railroad wheels, axles, car iron work, locomotives, etc.
To keep the railroads running, rails that needed to be replaced had to be replaced by cannibalizing minor lines and sidings.
See my site, Confederate Railroads, at csa-railroads.com.