The mythological descriptions of unicorns vary somewhat between two different, yet similar themes. The similarities are that in both depictions, unicorns have a gracile, horse-like body plan with a roughly one to two metre long ivory horn projecting perpendicular to the head from between and just above the eyes. The differences are that some legends depict unicorns as being small, roughly human-sized creatures, while other legends depict horse-sized creatures.
Another point in the mythological depictions of unicorns is that they are very strong, easily capable of carrying a rider (even the small type) at a rapid pace. They were also said to be an even match for a lion in combat.
Finally, Narwhal tusks were thought in medieval Europe to be unicorn horns, so we can assume that unicorns will have horns with similar properties.
So... horses are cursorial mammals, adapted to running quickly, though due to these adaptations, they do not achieve their maximum speed particularly quickly, nor can they turn quickly in comparison to other animals which are adapted to using their horns as weapons against predators.
If we compare a horse with a horn-wielding herbivore which uses its horns in self defense - say, a Triceratops - we can see if we put the two animals on the same scale, that the Triceratops is far more robust and muscular than the horse, to allow it to lunge and turn rapidly.
So... naively, it would seem that unicorns, following a horse-like body plan, would not be particularly capable at lunging with their horns, that their horns (if they are as magical as they are said to be) are of use mainly as instruments of healing, not harming.
However, given that unicorns are said to be very strong, either their gracile, horse-like body plan is rather more robust than the legends suggest, or they are magically strong. While this strength may be used for the mythical purpose of carrying maidens for whatever purpose, it is also just the trait required to make them effective at lunging with their long, straight horns.
Of course, if unicorns are small, carrying a rider would effectively double the weight of their bodies, making them far less capable of lunging effectively (just try jumping while carrying another person your own weight). On the other hand, a rider may be around only a tenth of the weight of a horse or a large unicorn, and would hinder the unicorn's lunge far less. From the OP's description, this is probably the type of unicorn in question.
So... these cavalry unicorns would be capable of lunging effectively even while carrying a rider, and quite possibly while also wearing steel plate barding. Their horns, like the tusks of narwhals, should be strong enough to be used as spears, as narwhal horns have been done historically.
That the horns of the OP's unicorns are 12 to 28 inches (0.3 to 0.65m) long makes only a little difference... a sharp-pointed horn backed by the better part of three-quarters of a ton of muscle and bone should easily be able to punch a hole through medieval plate armour, and would inconvenience even a person in modern kevlar armour. Similar to a fencer, a lunge of 0.3 to 1 metre would be quite sufficient to inflict a fatal injury to an opponent, where a penetration of the chest cavity of under 0.1m could easily be fatal to a human.
Armouring a unicorn would make it quite a formidable opponent on the field of battle, though even medieval plate barding left significant amounts of the horse unprotected.
So, my conclusion is that yes, a unicorn could (given the assumptions I've stated here) be an effective combat-capable mount upon a medieval human battlefield.