It's strictly tsmuxergui that creates a PGS stream from text when you create an M2TS, wasn't aware we were talking about MKV.
EDIT:
deho said:
By the way, I've muxed [the subtitles] with mkvmerge and the resulting mkv played just fine and the subtitles were ok. Then I tried to mux it with tsmuxer, to create a Blu-ray folder structure, but vlc wouldn't display the subtitles correctly, no matter which edit I use. Are you aware of this problem?
Actually, we were talking about M2TS, not MKV. So yeah, tsmuxer creates a PGS stream on-the-fly from text, and that PGS stream is the one flickering. I've seen something like this before and fixed it, but apparently this is a different situation because my fix didn't work.