I had this problem on a Bachmann class 66. One of the drive shafts kept coming loose at one end. I contacted Bachmann who were excellent.
This is the reply and it should be relevant to your problem.
"As the driveshaft is continuing to pop out it is possible that one of the drivecups has become damaged causing the shaft to not be held in place. It is also possible that the drivecup on the worm gear has been pushed on too far which is causing the driveshaft to fall out. It is also worth checking that the driveshaft is being correctly installed in the motor drivecup and is the correct way round (both ends are different), the end with the squarer lugs should fit into the motor drivecup and may not fit in the worm gear.
By first removing the bogie from the model, and then removing the worm gear assembly from the bogie tower, The bogie is secured by a single screw which can be accessed by removing the body, the wires from the pickups will also need to be removed from the PCB, these are located under two of the PCB tabs. You may need to do a small amount of threading/untangling to get the wires out so that the bogie can be removed. Once the bogie is out, the worm gear can be removed. This is secured by a cover which is clipped onto the bogie tower and may require the removal of the bogie tower top, held with two screws, to remove. Once the worm gear has been removed it may be possible to ease the drivecup further out on the shaft, a gear puller or similar would help with this. Care would need to be taken to avoid damaging either the drivecup or the worm gear when doing this, and also to not move it too far as this could cause further problems. It the drivecup is pulled too far it could leave not enough space for the driveshaft which could then cause the drive to lock or snap the driveshaft. It could also catch on the chassis causing unwanted noise.
With the bogie removed you should also be able to check to see if the drivecup is damaged causing the driveshaft to fall out. The motor drivecups are a little harder to see, but with the bogie removed you may be able to detect any damage."
Be careful using glue. The driveshaft has to have play to move in the cups at both ends to allow the loco to negeotiate curves. If you put glue on it this will not be possible.