I believe the sound to which the original poster is referring is part of the air system. Many locomotives are now fitted with air dryers with automatic valves to vent water and moisture which has condensed within the system. When activated, this valve emits a "spitting" sound as the moisture is discharged.
Bob