I agree with the others, a big thing for the engines and the rolling stock is to clean and lubricate them, if not sure how there are tons of references on the internet on how to lube these engines. After this period of time you might run into problems with the sockets for lights, they usually for the positive contact had this bit of plastic or compressed paper on a spring, that tends to fall apart over time. Wiring is also suspect, the old cloth wrapped insulation they used dries out and falls apart.
On the motor, the brushes may need cleaning or replacing, and the brush springs may need replacing. You also should clean the commutator on the motor (it is the disc the brushes press against, looks like a disk segmented into sectors), you can clean the surface of the commutator with light sandpaper, and you can clean the spaces between the segments with a small wood stick.
If the engine is having trouble through the O22 switch it could be the rollers are warped and not making proper contact or the wiring to one of them may be broken. On the switch itself, it is possible that the engine is binding going through the switch which is causing it to twist up off the rails. You could take the engine with the problem and slowly push it through the switch (this is especially true if the problem only happens if the switch is set to the diverging path but works straight ahead). It could be something with the frog being out of alignment or the guide rails have become blunted. If other engines have trouble going through the switch, it could also be that a wire that delivers power to the rails in the switch has broken or a solder joint failed, you would need to take theback cover off the switch to inspect the wiring.
I also would recommend using tuner cleaner to clean the e-unit and the drum, they tend to get all balky if they haven't been used in a long time, the tuner cleaner both cleans and lubricates it.