It is a complicated system which needs careful reading.

New building: rail station.
The rail station manages the vagons and trains, performing the role of a heart of transportation for a village. You use it in order to reach other rail stations, which are interconnected. Each rail station should be attached to a village and has the name of the village.
New building: depot.
A railstation should work in a partnership with another building (2x2 tiles) called depot. It connects to the station by a railway. Each depot has 1 train and a few coaches/vagons. Depot manages the trains: connect/disconnect a new coach; load or unload.
New building: train.
Trains could be build only on the railways. You can push them to move (like rams). When the train gets close enough to a depot, you will get action option connect. In order to disconnect the train you will have to use depot and press disconnect, then the train will appear outside of the depot boundary.
New building: coach/vagon.
They works similar to oxcarts - it has an inventory and slots for containers.
Coaches could be built only on the railways. You can push them to move. When the coach gets close enough to a depot, you will get an action option connect to the train. In order to disconnect the coach you will have to use the depot and press disconnect, then the coach will appear outside of the depot boundary
You can load and unload a coach on a railway.
There are two types of coaches: 1. For containers; 2. Domesticated animals. Possibly this mechanics aspect might be designed in a better way, since there should be a possibility to move animals on trains.
New building: station.
Station performs the role of a train stopping point. It will serve as a teleportation point towards a resource node.
Teleporting
In order to teleport you are required to move closer to the rail station, summon the needed train from the depot. Afterwards, a train will arrive to the platform. If there are a few people teleporting at the same time, they would have to sit inside of the train and chose the station or a rail station they would like to reach. Then they will be teleported.
There should be a few types of teleportation.
Immediate teleportation to the destination - the length of the travel will be estimated and the time required to travel will be assigned according to the distance. For instance, 1 minimap - 5 seconds, 10 minimaps - 50 seconds. The ride on a train is something like traveling by a horse twice faster. Each tile traveled should consume some amount of coal, depending on the length of the travel.
New building: railway/rails.
You have to build a rail per each tile. 1 rail/tile = 2 nuggets of hard metal + blocks of wood/rocks (metals are required for the rails, wood and rocks used as supporting construction). Therefore 1 minimap-long railway would cost 20 bars of metal. I think it should be done that way, but it might need some nerf.
You do not have to level the land.
You can build it like a palisade.
You can cross across railways.
If the railways were broken, you will appear in the middle of somewhere. You can continue your travels by pressing the railways and receiving an option to travel to the nearest station.
Details:
Rails might be broken, but it should have soak close to strongboxes from the Legacy + hitbox should be much higher. Rails should not be easily destroyed. Destroying other village rails will leave scents.
In the beginning, when the construction of the rail station is finished and it has rails connected to it, the owner of the particular railway should be the village which hosts the rail station.
When 2 separate rail stations connect with each other through railways, there should be permission-manager menu inside of your train station. It is important to prevent unauthorized rail connections and (ab)use of your rails.
In case the rails were broken by someone, the teleportation menu from your station should disappear to make it clear that the rails were destroyed. Animals, people and logs should not be an obstacle.
As the time goes, the numbers of railways will increase and you will need to build a cross-rail where 2 rails intercect. However, as I have mentioned before, each rail station has options to permit use of its railway.
Analytics:
Teleportation is a very time-saving way of travel and should cost accordingly resource-wise. Railways will become a very safe way of travel + consequently a very expensive one as well.
Nowadays crossroads could be built by any naked character, which does not seem right. Introducing the railways would mean hermits will have to integrate with the community and neighbor villages, creating a social capital. Altogether it will make the game more fun to play.