The romanticized part of that story was the friendship of the boys.
The railroad was the setting for the story.
Since the boys nearly get themselves killed by using a railroad trestle to cross a river I didnt see railroads as romanticized.
It was set in the boys’ past, and mostly remembered fondly. Before they could drive... an adventure not to be repeated. You could say that it was romanticized.