Frodo isn't the narrator, Tolkien is, so it cannot be assumed Frodo had seen or knew anything about trains. And despite the narrative ploy of author as hobbit-historian, Tolkien's intended audience was modern humans. He started writing LotR as a sequel to the Hobbit, so it's not surpring that he would carry on with the tone of his first book and reference things that young children could relate to.
At least there is nothing in the Rivendell chapters about Aragorn being faster than speeding bullet.