The OP mentioned using the PWM outputs of the Arduino to drive the variation of voltage for his train layout.
I have been interested in the videos that are produced by Julian Ilett from the United Kingdom and a particular project of his called the Muppet 2. It has to do with driving 4 Mosfets in a particular arrangement that I don't fully understand but it sounds like it may be relevant.
Here is a YouTube video that explains a part of what he is up to. There are more of these on his channel relating to the Muppet 2 project, buck converters, etc. Mosfets!