Try a fine bead of Power Grab adhesive on top of the light rail, before you press it into place. The Power Grab is thick enough to fill gaps and opaque enough to block light. Works well with crown on cabinets too. Any squeeze out cleans up with water, and the high tack of the stuff helps to hold the molding in place as you pin it.
Cheers,
Bass