With the molten agar the chemical just diffuses throughout it. As the worm crawls on top of it some of the chemical will cross the cuticle (different chemicals will be better able do do this), and also be ingested through the pharynx. There’s a surface layer of liquid that sits on top of the NGM (important when taking into consideration locomotion mechanics, etc), so I assume this will be where the chemical gets ingested from, rather than from the solid agar itself. It is also possible that the chemical diffuses into any OP50/food that is also on the plate.
Adding the drug to the molten agar allows you to control the dosage. Applying the drug to the surface of solid agar does not, as the concentration to which the worms are exposed is dependent upon how well/poorly the drug diffuses.
-Harold