After further research and experimenting, I've figured out how to do it using ffmpeg from command line.
Extract the relevant video stream (in my case track No. 2, which has index 1) into a temporary MP4 file, using the same codec as the source. The resulting video will have no audio:
ffmpeg -i original_video.mp4 -map 0:v:1 -codec copy rear_no_audio.mp4
Extract the audio stream into a temporary M4A file:
ffmpeg -i original_video.mp4 -map 0:a:0 -codec copy audio.m4a
Merge the two streams into the final MP4 file.
ffmpeg -i rear_no_audio.mp4 -i audio.m4a -codec copy rear_with_audio.mp4
The argument of the -map option includes v for video and a for audio streams. The second digit is the stream ID, which can be found by running
ffprobe original_video.mp4