I don’t think the train in Over the Garden Wall was real. the show’s concept seems to have been largely inspired by the american memento mori/folk song Little Black Train, which was rewritten & played during the relevant part because the Little/Old Black Train is a metaphor for death & it probably nearly hits wirt & greg because they nearly died.
but more than that, it’s an old-fashioned steam locomotive travelling on a derelict & overgrown train track in the middle of the night
it could be a ghost train, another classic element of american folklore, & i think it’s also part of the blending between the world they were leaving & the unknown. i wonder if anyone but wirt & greg heard its whistle blow?