How to Build a Cargo Train with Locomotives and Train Cars
Assemble the train
Craft a Steam Locomotive or Energy Locomotive. Attach Train Cars behind it using Vehicle Chain: use Chest Train Car for items, Barrel Train Car for bulk items, or Fluid Tank Train Car for fluids. Each car chains to the one in front so the whole train moves together.
Lay the route
Place Locomotive Route blocks along the path. Use Switch Rail, T-Junction Rail, Automatic Switch Rail, or Automatic T-Junction Rail where tracks branch. Junction Rail and Vessel Corner Guide Rail help steer at corners. At each stop, place a Locomotive Docking Rail or Train Car Docking Rail so cars can load and unload.
Load and unload
Put a Rapid Hopper or Fluid Hopper beside a docking rail to move items or fluids into and out of the cars. A Barge Dock or Tug Dock handles the boat equivalents if you mix water and rail legs. A Vehicle Detector at the dock can trigger redstone to start hoppers when the train arrives.
Power and control
An Energy Locomotive needs a Vehicle Charger along the route. Use a Conductor's Wrench to rotate and configure rails, docks, and detectors. A Locomotive Route records the path the locomotive follows between docking rails, so the train repeats the trip without a player aboard.