Problem using transformation constraints to rotate gears
The best way to do these kind of thing is using a combination of armature and Animation Nodes. download this addOn from here.

Do the following:




Add an armatures in the location of each gear and set its rotation
Combine all armatures (so you will have a clean armature for all of
your gears)
Create nodes in animation nodes as explained in the gif file
Link each gear to the corresponding bone.
Done!