New ones, starting with the Yuans and even some of the later Songs, might be using a domestic engine. Even if it is similar or copied from MTU, its not MTU and would likely have indigenous parts.
But predating the shift from foreign to local diesels, some of the earlier subs may still have bonafide MTUs.
Its not the question who owns the engines, its whether where will you get the parts and maintenance from? Who will be responsible for the maintenance?
The point, at least based on what it says in the article is that China is building new Yuans i.e. 093A/S26T with MTU engines for the Thai instead of Chinese engines:
To reiterate, the situation now becomes one where China is offering a couple of existing Yuans, presumably already sporting German engines, to the Thai Navy for training purposes due to delays with the new
bespoke Yuans, also with German engines, that the Thai actually ordered.
As far as MTU is concerned, if they're adamant about China not exporting their engines, then it doesn't matter who owns or maintains them like you said, since MTU would get no custom from either China or Thailand anyway, hence no market share which is the whole point of this debate.
Conversely, if market share is what MTU cares about, then it makes no difference who buys from them and what they do with the engines since they're not competing with anyone anyway. China, as a proxy for the Thai Navy, is pretty much the only realistic customer for MTU in this deal because what's the point of Thailand purchasing directly from MTU if they don't have the submarines to install the engines to?