I always understood that a ditch was a (semi-permanent) drainage channel whereas a trench (except in the the warfare sense) is a temporary excavation to enable infrastructure work to be carried out.
The BBC doesn't seem to know the difference. They reported an accident in which a car crashed through some roadworks and fell into a hole containing a gas main which was in the process of being installed.
They called this hole a ditch - see