Do the gobies share the same "hole" or do they have different holes?
I have 2 yasha gobies that I wanted to pair up (they never did) that would fight over the shrimp. As in one would try to move the shrimp via its mouth to it's "hole", and the other would look like it was trying to protect the shrimp. The shrimp was moved from hole to hole numerous times, and was never hurt or fought the moving. I finally put on goby in my 29 nano and the other stayed in my main tank. They now each have their own shrimp in separate tanks.
I am not a fish expert by any means, but I know from my experience that they will fight over the shrimp if they are not paired. Luckily in my case the shrimp lived and is still doing well.
If they are sharing the same hole, and the shrimp was still being attacked by one, I agree size could play a part. My wifes tank went through the same thing as above. The goby was much larger and didn't care for the shrimp. The shrimp went in the hole, came out in 2 bits to be discarded about 6" from the gobies hole. Wife found another shrimp quite a bit bigger and the goby and it were instant buddies.
As I say a lot about things in my tank, "Strange little critters we will never fully understand"