To complete the mission, you must either destroy all the pirates or keep the Digger alive for a certain period of time. It is unfortunate that the AI differentiates only between warships and freighters, ignoring the distinction between warships and warships-that-must-survive, and that does make this mission particularly difficult. I had to reload several times before I was able to beat off the pirates before the Digger went on a suicidal charge. Then, of course, I took advantage of the game's short memory and punished the Digger for its stupidity by destroying it myself
.
Anyway, I don't think you actually have to beat this particular mission to continue the campaign, you'll just miss out on some money and get a less than congratulatory greeting when you report in for the next mission.