I've found some hard science!
In "Preliminary studies on the ability of plant barriers to capture lead and cadmium of vehicular origin" by Filippo Bussotti et al, done in Italy, where they tested roadside grasscuttings, topsoil and tree-leaves. Turns out they all contain significant amounts of lead and cadmium, both highly toxic, but there's a strong correlation with distance from the roadside, and number of plantbarriers in between. Note: research done in 1994, more people drive unleaded nowadays AFAIK.
An example: gras growing within a meter from the road had 49 parts lead per million, 2 meters further 25 ppm, 12 meters from the roadside had 8 ppm, and if there's barriers it's even lower.
Soil had much higher accumulations (600 to 40 lead ppm, depending on distance/barriers).
Another indication roadside food should be avoided here
.More reasons not to eat leafy roadside veggies here
Understanding the routes of plant contamination has been a key focus of the research. Tests across a range of plants revealed heavy metal concentrations to be highest in the plant leaves, followed by roots, fruit, and finally the seed.
The research team established that in leafy vegetables, such as Amaranthus, contamination was primarily via atmospheric deposition, rather than uptake through plant roots. Some of the contamination was in the form of a surface film which could be washed off, but most of the contaminants were found in the leaf tissue.
Crop choice and site selection have been key issues for discussion. Maize, for example, is recommended as safe for roadside cultivation. The grain is protected from exhaust fumes by the outer leaves, and only insignificant amounts of heavy metals reach the grain via the plant roots. Legume crops - such as peas and beans - are also recommended, although the outer pods should not be eaten.
There you have it! Legumes can be safe to eat in one of the more polluted places in Uganda.
(Nuts are 'relatively' safe
, and vitamin C intake in general ensures increased resilience to pollutants)