Every time you have:
maybe some stuff,
then a sublist with the right tail,
maybe some more stuff,
then another sublist with the same tail
and maybe some last stuff
then
replace all that with
the first stuff, the revised sublist, the more stuff and the last stuff
and repeat all that over and over until there are no more changes to make.
In[1]:= {{a,x,y},{b,x,x},{c,y,y},{d,x,y},{e,y,y}}//.{h___,{p_,q_,r_},m___,{s_,q_,r_},t___}:>{h,{p+s,q,r},m,t}
Out[1]= {{a+d,x,y}, {b,x,x}, {c+e,y,y}}
Think of a more efficient method if you list has millions or tens of millions of sublists.