Merging mp4 files and preserving subtitles
You may consider to use either

Subtitle stream of mp4, e.g. https://gist.github.com/xer-rex/913db0dcef06c0304acd1fcb3712cd04
or
Burn-in subtitle in video of mp4, e.g. https://gist.github.com/xer-rex/bc80b5fbd23d1b91bb4737439816d773