My understanding is that 右に同じ goes back to an older form of government where the when the 左大臣 (sasaijin) or Minister of the Left would agree with the lower-position 右大臣 (udaijin) or Minister of the Right, by saying 「右に同じ」, or “same as (Minister of the) Right”.
In present times, 「右に同じ」 has a meaning of “I agree with (that person)”, regardless of social standing (and especially regardless of physical location). The positions of the characters is just a coincidence (or intentional placement?) in the comic panel.