I am not an expert, however, from what I have read and tried, this is one way to achieve good results:
1. Do not place any glue or adhesives on the roadbed or track.
2. Lightly sprinkle your ballast from a cup, just a small amount at a time. You can always add, but it is difficult to take away.
3. Use a small brush (flat edge type) to position the ballast. Make sure the ballast is off the tops of the rails and positioned exactly where you want it.
4. Take a mist sprayer pump bottle that sprays a gentle amount of "wet water" (water and a drop or two of liquid detergent) on the ballast. Do not aim the sprayer at the ballast, let the light mist "rain" on the ballast.
5. Mix some matte medium (white glue that dries flat) with water at a 1:1 ratio, then use an eyedropper to "flood" the glue in between the rails. Don't be afraid to use alot of glue here. The glue will permeate all of the ballast, between and outside the rails.
6. Allow to dry overnight. It should be rock solid the next day.
The most important aspect of this process is to wet the ballast (#4), other wise you will obtain a cake-like ballast, where the surface is glued, but the ballast underneath is loose.
Be especially careful around the turnouts and take your time, you do not want to have any ballast interferring with the mechanisms.
Everyone has their own methods and glue formulas. Some modelers like to use alchohol rather than wet water. My method is one of many ways to do it.
I would strongly recommend searching this topic on the forums, as much has been written on this popular topic. Additionally, there are many scenery books available that can provide you with a wealth of knowledge.
DOG