My stab at a sound generator for trains, though this is much more theoretical.
Essentially, it'd follow an 'ADSR' profile, though in this case it'd be Accelerate, Coast Transition, Coast and Stop. Each one would have definable key points along it, where you'd basically configure a synthesizer of sorts to generate a wide variety of sounds. (I was thinking something like an OPL3 - just enough operators to make complex sounds with FM and AM sound modulation)
At each point, you'd determine how the last phase of the profile would end and how the next would start. This would allow the ramping up noises seen on EMUs, but also allow for aspects of the synthesizer to raise and lower in volume.
If the train is going at a set speed, it'd use the coasting sound, but if it's accelerating or decelerating, it would interpolate the keypoints on either the Accelerate or Stop profiles based on the throttle position.
As sending a series of synthesizer patches is probably cheaper in terms of data compared to sending entire sound samples, this might be a performant way to make a variety of somewhat accurate train noises. Obviously, it wouldn't be PERFECT - you try making the sound of a steam engine with a SoundBlaster - but it might be good enough.
Oh, and how would it work on a train? Place a block on the train, define the profile, the sound would come out of the carriage the block is on. Same as the other half-dozen 'train sound' suggestions.