
When a factory and a city or port are placed near eachother, railroads will be spawned to connect the buildings together. Trains may only travel where a Railroad exists.
Adding further buildings within this distance will cause more rail to be spawned, creating a mesh. It is also possible to make a train loop.
On launch, the following buildings are able to be connected:

The maximum distance within which a factory, city or port can connect to another station to form a railroad is 80.
The maximum length that a single railroad connection can be is 100.