The point is that I really cannot be sure there will be never any shortcircuit, as the project is about electric train: an accident, or simply a screwdriver crossing the rails, pfuit the shield is out !

So, I need some device to limit output current.

I could try with software, as soon as the current raises, say 1.9A or so we shut down everything.Is it a reliable solution ?

Or I could put some current-limiting device to protect the shield. Do you have any advice about the device I could get and install ?

The simplest way to limit current is to rely on your power supply. Most power supplies have a current limit on them and those that don't can only supply a certain amount of current anyway.With something like current rating then there is not a hair trigger between safe and blown and while you must not exceed the maximum current rating it is not instant death if you do.One simple form of protection against shorts is a device called a poly fuse, that will go high resistance when its current rating is exceeded, but it is often slow in electronic terms. An electromagnetic current trip is also useful. I remember my train set controller had one of those way back in the 60s, but again in electronic terms it is slow.You can build current foldback regulators, which in effect is the current limiting part of a power supply. The current passes through a low resistor and so develops a voltage. When that voltage exceeds a certain point it triggers a shut down.