I'd design the ship around the logic of piracy. . .like you heave to, let them get close, then cream them with no notice close up.
Counter piracy is tough on making a profit though, as with nukes in play, how badly do you want to trash the pirate rather than just enough to take it over? Like, with the tonnage allowed for with a merchant ship, you could likely hide one really nasty pow in there, and just surrender, then dust the pirate with a sneak shot, but I dunno that you want to risk "Mostly dead" vs a vessel likely in the police or military model range.
If word got out about an X ton merchie with a surprise, you might get pirates holding off at stand off ranges of targets that size and sending shuttles in, then only closing in after the ship is confirmed captured, which would screw that up.
Historically, judas goat ships like that tend to work either vs shambolic pirates, or when funded by a national government or major corporation, so the ship is actually a military grade ship pretending to be a merchie, rather than an armed merchant vessel.
It might work if you have pirates akin to the Malay and Chinese pirates of the 18-19th century, where the tech level disparity meant that even armed European merchant vessels could take on a swarm of pirates. . .if you establish a setting where the pirates are numerous but weak, the armed merchantmen makes more sense.