How Do I stop the Red and Green Cylinder from moving
Tell me if that simple solution could answer:


Create one unique armature from bottom to top with bones following your object shape.
Put your armature in Pose mode. Select an arm, then select its bone, and ctrl P > Bone to parent the arm to its bone. For the vertical arms, select the bone it is supposed to be part of and same thing, parent them.
Move your bones, the arms should follow in the right way.