Heck, not even that - just don't threaten the families with prosecution, and use prosecutorial discretion. In a dog-eat-dog world with a nation against a bunch of pirates, and the law forbidding ransom to the pirates, it is beyond stupid to announce it is okay to pay ransom to the pirates.
Tough spot for any families with hostages. Me, I'd break the law, probably, and submit to whatever punishment the government chose.
It's like Uber announcing that they will forbid their drivers to carry guns. Well, for all I know, there may be liability reasons or something that might make that rule justifiable. But why ANNOUNCE IT?????
BTW - are airline pilots allowed to carry nowadays?