Hello Walter,
After looking for a while at the Lego mechanism it seems to me that it is a "superimposition gear" arrangement. Kind of difficult to explain, but I found a lot of images on Google.
Basically (I think) the main motor is to the right (not visible) and moves the chain. The small motor seen below in the middle must be the one that provides the superimposed movement.
When the small motor is stopped both shafts move at the same speed as provided by the main motor. When the small motor moves left or right it turns the differential cage and "superposes" a second movement which makes one shaft turn slower and the other shaft turn faster.
This is used in track vehicles like tanks or bulldozers and also on some clamshell excavators to syncronize the drums of the hoisting and opening ropes.
Not 100% sure, but I think that's where to look for.
Hope it helps to let you sleep again.

Regards Jurgen