Well, the Dido was a light cruiser, not an escort.
It was with the convoy to protect it from German raiders - auxiliary cruisers (or to fight off even real cruisers, like the Scharnhorst).
It was not equipped with anti-Uboat gear and didn't carry depth charges.
Not able to fight a submerged Uboat, not agile enough to outmanouver or ram it - what should the captain have done? Present himself as a target, to be sunk and leave the convoy totally unprotected?
You have sunk the whole escort screen, so do your job and sink the merchants and let the Dido captain tell the horror story at home.