Yorkshire undone by teenage legspinner as fiercest rivals land morale-boosting win