There is only one explanation for the enemy knowing that you'd come after their 104-gun ship: it looks like there's a spy in your midst. The magistrate's son charges you with finding that spy.
First you will have to talk to a secondary contact in town, who will tell you about a Captain he wants to interrogate in this matter. After this you can start the main part of the mission.
This is a sea battle against three opponents. Your main target (which you'll have to board) is about level 32, and it will be escorted by two lower-level (around lvl 24) guards.
- The Informant Must Not Be Sunk