Assuming
ffmpeg -i a.mkv -i b.mkv -c:v copy -c:a copy -c:s copy -map 0:0 -map 0:1 -map 1:2 -y out.mkv
NOTE: The mapping syntax is:
To determine the mapping for the subtitle, run:
ffmpeg -i b.mkv
and see which stream contains the subtitle data.