It's a vehicle, basically. Storybrooke was way too small to have one, but busier areas like cities have train lines that'll get you around the city or stations that connect different towns. They're made up of... I sound like an idiot explaining this, but they're usually a series of big metal boxes that run on a track, essentially. People used to use them to travel cross-country all the time, but mostly they're used for cargo now.
Or not now now, because the world ended, but where I come from they're mostly cargo.