The water-filled trench around a castle is called a moat.
View page
I think that the 'trench' you are thinking of is a moat. You
could say that it is a trench full of water that surrounds the
castle. If you are not thinking of a moat then I am sorry.