How should I structure my city in order to make up for the teamster's terrible AI?

This answer is courtesy of FritoPatata's excellent guide which you totally should read on optimizing traffic in Tropico 3. Everything still applies in Tropico 4.

His key insight is that:

  1. Raw Materials should be given the fastest possible path to factories, and in turn factory goods should be taken to the dock for export as quickly as possible.
  2. Based on the above ideas, the ideal place for a Tropican to live is as close as possible to work while keeping their needs in check and in the best manner possible. The tropican also should not reasonably interfere with the transportation of materials whether raw or finished.

Hence, it is necessary to give the teamsters priority on the fastest transportation route on the island, while minimizing tourist traffic (by placing the tourism district separate from the main city) and building residential buildings within walking distance of the factories to encourage workers to walk to work:

The main thing I am advocating in my model, is a clear and traffic-free route for your raw materials to make it to the factories and the finished goods from the factory to the dock as quickly as possible. Thus, it is important that you make every effort possible to provide a continuous stretch of road from raw materials, through production, all the way to export with as few intersections as possible. While it is important for your people to get to and from work as quickly as possible so they can produce and refine the goods, they often work in shifts, and usually half of them will be working at any given time (averaged out). But, all the production in the world doesn't mean anything until those goods get to a dock.

He provides the following design (which works quite well):

enter image description here

The reason for the circular design is because the intersection logic in the game is bad and can lead to gridlock (and confusion for the teamsters as in my case).