Hi,
You can check this using a rule. By using the following xpath you can check this.
count(/my:myFields/my:group1/my:group2[my:field2 = "a"]) >= 1 or count (/my:myFields/my:group3/my:group4[my:field4 = "a"]) >= 1
Put this expression in the set condition on the button rule.
Then add action what ever you want.
Here /my:myFields/my:group1/my:group2 -> first repeating section xpath.
my:field2 -> field ion the first repeating section
/my:myFields/my:group3/my:group4 -> second repeating section xpath.
My:field4 -> field in the second repeating section.
"a" -> value with which you want to compare.