As the most advanced form of transportation on land at that time, railroads were important to both armies during the Civil War. Railroads were used to transport troops, supplies and weapons. The armies also used them to gain information on enemy troops and for tactical missions, including close combat.
An advancing army often had to rebuild a railroad that the opposing army had derailed. Armies often fought over control of the rails. http://www.geocities.com/yosemite/trails/9401/civilwar.html
Armed trains carried combat ready troops and artillery. The locomotive was placed at the train’s center, so it could be protected. Flatcars were at the ends loaded with armed troops and artillery. Passenger or boxcars were in between.
Trains of the Civil War era were the precursors to “tanks, armored personnel carriers, engineer vehicles and self-propelled artillery.” http://www.historynet.com/magazines/american_civil_war/3026731.html?page=1&c=y