If you sink nuclear ship you won't get nuclear meltdown. You have enough thermal mass to cool down anything if you are underwater. Some level of loss of nuclear material would happen. But meltdown is not something that would happen.
Either way, "loss of nuclear material" is the real concern isn't it, instead of just the nature of how that loss happened?
The question still stands. If a country knows they're potentially going to cause a nuclear disaster by hitting one of these ships on their shoreline, are they as likely to shoot at them?
And even among the non-hardliners mistakes are rampant in war. It's not about what they're likely to rationally do, it's about what some local, demoralized missile officer who graduated in the bottom 20% of his class does when he's cut off from command and drinking too much.