I've often thought that a reversing trolley with timed stops is an ideal application for an Arduino-based controller. Having made this observation, its not anything I've implemented, but the Google machine suggests that others have - in what appears to be varying degrees of complexity. One of those is having the ability to reduce/increase the voltage with time, so the trolley behavior isn't just sudden stop/start. You might take a look at this for starters: https://modelrailroadelectronics.blog/throttles/
My $0.02 (which along with a couple of bucks will get you a cup of overheated coffee...)
rich