トラックは狭い道を塀にかすめるように通った。

English Translation

The truck scraped along the wall in the narrow road.

かすめる is grammatically incorrect and sounds unnatural. It should be 塀かすめる. As a result, the double を (i.e. 狭い道を塀を…) becomes unnatural. So, I would alternatively propose:

トラックは狭い道かすめるように通った。

トラックは狭い道で塀すれすれを通り過ぎた。

トラックは狭い道の塀ギリギリを通り過ぎた。

Both すれすれ(スレスレ)and ギリギリ are onomatopes, meaning “almost” or “close to the boundary/threshold”. I personally don’t use かすめる in this context, and thereby I prefer すれすれ or ギリギリ.

FYI: the original Japanese sentence was sourced from Tanaka Corpus (田中コーパス) and migrated to Tatoeba. Accuracy of Tanaka Corpus is quite low.