This is just a guess, but maybe your cavalry unit was not routed by the enemy but by its position on the field. Sometimes units get a morale bonus for being near the general. Also I think (I'm not sure) they get a bonus for local numerical superiority. If your cavalry had low morale and was almost ready to rout anyway, the loss of some such positional bonus might tip the balance.