There is a huge difference between the more sordid and shameful actual history between the Civil War and the final desegregation in the mid 20th century, and the self-congratulatory official version of it. But both are well documented for those that want to know. For that matter the official history of the Civil War and the more dispassionate one as found in say something like "Battle Cry of Freedom" by James McPherson, gives one a very nice sense of contrast between the two. Shall we say that the commitment towards racial equality was minimal to non-existent even among most Northerners at that time. Removal of Slavery was not the original goal of the Civil War, but the overplaying of their hand by the Confederates precipitated that shift of emphasis about half way through it.
As for rail passengers service, segregation continued well into the 20th century south of the Mason Dixon Line.