If all you want is the audio, use an audio recorder. Like a Zoom H1. I use a H5.
The closer you get to the audio you want recorded, the better the audio will be. If the mic is inside the train and need the noise from the wheels, the mic is in the wrong place. Audio done well is not easy.
Using a device's convenience feature rather than a device primarily designed specifically to do something will typically be problematic. Your Galaxy S5 is a phone. Audio recording is a convenience feature. A camera is a camera - just because it has a mic does not mean audio will be its best feature - rather, external mics are typically more appropriate.
What is your budget? A Canon HF R700 camcorder has built-in mics that might work if you can get closer to the audio source. The mics on a Sony FDR-AX1 will be better.