Maybe this is obvious, but in case it hadn't been thought of:
Use the "take from stockpile" mechanic: set up your main stockpile, set up other stock piles at the place where you want items to come from (e.g. your dig site). Build track between the locations (has be adjacent to the stock piles?). Any spare carts are automatically added to the track (can be limited just like stock pile bin/barrel limits). Forget about collisions, just assume all the track is doubled. Then you set the "take from stock pile" settings on the main stock pile, and target the source stock piles.
From then on the dwarves can just use the carts automatically (obviously it needs a bit of AI work for the dwarf to check if there is a route via cart, then to find the nearest cart that's free and go get it, but its not complex compared to some of the other game mechanics).
So if you are chopping a bunch of trees:
1) set up your main stock pile next to your carpenters workshop (the "terminal").
2) set up a source stock pile at the location you are chopping (a "station").
3) set the "terminal" to take from the "station"
4) build a track from the "terminal" to the "station" making sure it is adjacent to both at some point
5) build some carts
6) make sure some dwarves have wood hauling
7) start chopping trees. Firstly a dwarf will move chopped wood to the nearest stockpile, which is the "station". Then another dwarf will grab a cart, run up the track, fill it with wood and haul it all back to the "terminal".