For inline magnet cars I use loctite #271(red) or #609(green) for steel pinions.On the BSRT delrin plastic pinions I am using loctite superglue Control gel,real good control as the gel does not run all over. Hope this helps you out. Just a little bit for either don't over apply.
Loctite also makes a #680 which is thicker than #609.
Using one of the loctite primers on the shaft and pinion will clean any
oil off and cure the loctite faster. You can also use acetone to clean the
parts with. It does the same thing. I use these at work all the time.