By the end of 1865, only 40 miles of track had been laid across the inviting valley. Veterans for the Railroad's Ranks The end of the Civil War brought a change of fortune for the Union Pacific.