I reported this a while back as
https://crawl.develz.org/mantis/view.php?id=11219, and I doubt I'm the first. I think this behaviour is by design. I don't like it; either it annoys the player by being a hidden way to waste XP, or it allows Hypothetically Optimal Man to build up "drain armour" in selected skills [1]. Neither seems like desirable gameplay.
On the other hand it would be odd if you could train (say) M&F to 27 with 29,750 XP then overtrain it by training Staves, but were prohibited from first training Staves then investing 29,750 XP in M&F, so a change to this behaviour would want a little thought. (Excess XP from crosstraining is just lost, to prevent "drain armour"? Interacts badly with Ru's sacrifice skill...)
[1] Of course thinking both these things at once suggests a certain confusion of ideas on my part.