When you use AHG, you need to record the speed at the beginning of the segment you are about to AHG and also the end speed, both in meters/second. The details I'm not sure, but all I know is that AHG will screw itself up if you include special track segments (station, lifts, brakes).
If it still doesn't work, simply tweak around with the startspeed and endspeed values... I'm sure it'll amount to something.