The pirates would use the deadliest weapon known with application in space. This is, of course, the can opener. For ease of application, large can openers are preferred. Spacecraft will be made of thin materials, to save on mass and to thereby reduce the energy expenditure at propelling any spacecraft up to cruising velocity.
This also means any gunfire will have bullets punching through internal walls and exiting via the outer hull. Very rapidly the ship will lose air. Space pirates only need to match velocities, pull alongside and knock on the airlock door, waving their can openers and hand guns. The threat would be immediately apparent: Open up or we will open you up and vent all your air.
Now there is one problem with the OP's scenario. The cargo ship is large, obviously carrying a lot of valuable cargo, ripe for the picking by space pirates, but the space pirates themselves are flying in a small spaceship. The whole object of piracy is economic, i.e., to make money by stealing cargo from otherwise helpless vessels. Unless a small amount of that rich cargo is exorbitantly valuable, then this act of space piracy isn't economically viable. Take your can openers and go home.
Except the space pirates will probably do real pirates do. namely, force the cargo vessel to change course and head to a location where the cargo can be transshipped and redistributed to destinations where the space pirates sell it and make a handsome profit. Otherwise you're out of the space piracy business.
This is glamorous version of space piracy. A more 'realistic' version would be that the cargo freighters loaded to the jets with rich bounty, will be robot vessels. There's no need for a human crew. Besides humans take up a lot of space and they need roughly a ton of life support per person. A waste of good propellent and energy to dispatching a manned vessel across space. Also, humans will have to be paid. Robot freighters are so obviously the way to go.
Do the space pirates turn up threatening the computer systems to heave to and prepare to be boarded? Of course, the space pirates will have the same problems. So the most likely scenario is a space pirate vessel, entirely computer controlled, matches velocities and dispatches a robot to board the freighter and reprogram its navigation systems to change course for the pirate base.
Piracy is a business and will be run like a business. The Galactic Jolly Roger Corporation will continue launching its pirate drones to intercept innocent cargo freighters and then redistributing the pirated plunder to the outer colonies until such time as they can no longer turn a profit. The company would then be wound up and taken off the stock exchange of Capella VII.
Actually the simplest, and also the most profitable way of doing space piracy would be to hack the navigation and control systems of a cargo freighter. When the right moment happened during its voyage this 'hack' would take control and steer the vessel to the pirate base.
Sorry, no glamour, no piratical hi-jinks, and no Yo Ho Ho. Just the cool headed mechanics of commerce, astrodynamics, and robot vessels with a dash of cyber-crime.