You need to measure the speed of the train with an encoder on one of the wheels?
An integrator may be what you are looking for.
Confirm or correct my understanding of your description.You want the throttle to drive the sound card directly, which it does now.You want a modified throttle signal to go to the PWM motor control circuit so that the train accelerates and decelerates more slowly.I could see an arduino sitting between between your throttle and your motor circuit, taking the throttle input and spreading it out over time, giving you the slow acceleration and deceleration you want.If your motor circuit can take a PWM input, then you could feed it from the arduino. If not, a digital potentiometer should do the trick.If it were me, I would also want an E-stop button that would instantly feed the motor a stop signal. We put a long, slow acceleration curve on our HO trains and it is surprising how many times we hit the red button.