Make gates three tiles wide instead of two so carts can get through. Simple enough to implement, I think you'll agree. Although the models will need to be changed.
Or, make an additional form of gate called a "town gate" that is four tiles wide, but requires not only a large amount of resources but also takes some time to swing open and closed.