Try some kind of panel adhesive. Liquid nails is one brand. You can run a bead on the trim, press it into place to distribute the adhesive, pull it off and let it sit for 60 seconds or so. Then you can stick it back on and it should pretty much stay in place. Don't use too much. It's a pain to clean up if you get any squeeze out. Just pin nail it with some brads to be sure it doesn't move while the adhesive dries.