I made an interesting observation a while back while playing as Romans on Marlas World Map (correct starting locations) with patch 1.16. I was at war with Egyptians and Babylonians. I decided to cut off all Egyptian trade routes by taking a city where the Suez canal is in the real world. This was quite early and they had no harbors yet, nor any roads to the Zulus to the south. The only possible trade route to all other civs was one road that went through my newly occupied city.
To make sure that their trade routes were cut off, I checked the trade advisor screen. Egypt had still either "active" or "potential" trade routes with all civs except me, Zulus and those in America. This puzzled me a bit so I decided to pillage the road, then check the trade advisor again. This time Egypt had no possible trade routes with anyone.
Since this happened I am pretty sure that the AI can (or at least could) trade through your territory even during war.
Edit: I forgot to mention that I waited one turn before checking the trade advisor the first time, in case it took one turn for the "blockade" to have effect.