Not sure of the purpose other than to make the underground railroad very literal and concrete. When I was a kid and learned about the underground railroad, I at first envisioned it as an actual railroad under the ground.
Both. At first it bothered me that the railroad was portrayed as a real train underground. As the book progressed, I enjoyed it as a part of the story–made up but interesting none the less.