Has the whistle motor been serviced - cleaned, and lubed?
Are the tracks , wheels and roller pickups clean? Especially important when the whistle operates with the tender stationery, but not when it is moving.
The transformer whistle rectifier may be old and in need of replacement even if it blows the diesel horn.
Larry