They most likely had to drink or consume it somehow by mouth.
In a few hours the Mandrake Draught will be ready and everyone who was
Petrified will be all right again.’
She’s just giving out Mandrake juice – I dare say the Basilisk’s
victims will be waking up any moment.’
Draught
a portion of liquid to be drunk, esp a dose of medicine
the act or an instance of drinking; a gulp or swallow
The verbage used in the book is fairly clear its a liquid, as well as a liquid thats ment to be be drunk, instead of a salve, lotion, or cream which would be applied to the skin.
Most likely the touch of the mandrake juice would loosen up the mouth, throat and on its way to the petrified person's stomach spread the cure throughout the victim.
Magic is undoubably at play in this scenario, however, a real world similarity is to a diabetic who goes unconsious to extreme low blood sugar, sugar can be rubbed into the unconcious persons mouth to help raise blood sugar levels.