Biggus
"They are effectively committing armed robbery"
That is true - but you forget the rest:
They are holding their captives as slaves for whom they demand ransoms. If their demands are not met then they will dispose of their captives and sell the captured vessel and try again.
You forgot the Kidnapping - False Imprisonment - Blackmail and potentially Murder.