That's right. Truth is not a defense at all in defamation cases. If your intent was to embarass or defame then even if what you said was true you can be convicted and do time.
Not sure if the case could be filed in Thailand. But if it was, Musk would be convicted for sure. The rescuers are all heroes in Thailand and what Musk said was very offensive and designed to do nothing other than defame the rescuer. Nothing would come of a conviction as long as Musk never visited Thailand again since nowhere would extradite him.