When a loco in a 40 mph zone encounters a slower speedboard it slows to that speed, when the rear end of the train encounters a higher speedboard (than the previous slow speedboard), it only then speeds up, when the tail end passes that higher speedboard.
So if you have a 5280' train that encounters a 10 mph speedboard, if you measure back with a ruler 4000' and place another 40 mph speedboard, your train will slow for 1280', then it will speed back up to 40 mph, once the last car passes.
Easy to remember:
Down speed (decreasing) = first loco
Up speed (increasing) = last car