1866, echoic of a working steam engine. As a verb, from 1884. Related: Chugged; chugging. Drinking sense attested by 1940s (chug-a-lug), probably imitative of the sound of swallowing.
the engine chugged down the street