The metallic body of trucks gets charged due friction between them and the air rushing past them
This charge being large can produce a spark (it may)
And this is dangerous
So they have metal chain dragging along the ground
The charges produced pass to the ground through the chain 
Even nowadays tyres contain  some carbon compounds in their rubber which makes the produced charges leak to the ground