When its inventory fills up, the cart should go back to where it started ( cargo manager? ) and dump its items there.
Can't you just pipe/suck that into an ender chest?
If you only go in one direction, it'll consume more fuel each trip due to the length. If it mines coal, it should restock its...