Scottish Fire and Rescue Service firefighters were "forced to retreat" as a gang of youths attacked their engine, smashing their window.