That's actually not true. Capitalism always works, no matter the problem. However, free markets don't account for externalities, and in some cases supply/demand constraints create unacceptable non-economic problems. Thus, to avoid the effects of non-economical problems then it's preferable to create economic incentives that reflect the non-economic constraints.
If road taxes are directly tied to the things causing wear, then every company causing that wear has an incentive to find a transport method that causes less wear (assuming that the additional cost of that transport method is lower than the cost of the road wear - that's why some people argue that using markets is better than using rules; if you've properly priced the market, the market will balance between road and rail based on cost.)
That's why it's important to make sure that all externalities are directly tied into the cost of whatever is creating those externalities.
If the road maintenance cost of transporting the potatoes is priced into the potatoes, then the potato company might opt to transport the potatoes in a different (cheaper) way.
But if the road maintenance costs appear free or near-free to the potato company, they have no incentive to care about it. Also it makes drivers who don't eat potatoes subsidize the potato consumers.