Depends on which language you choose. Each button has a unque name based on the occurance number of its parent subform (assuming the parent subform in the Master page is called Page1). You can see this by adding the javascript code this.somExpression to the master page button. You will see that the expression is generally of the format form1.pageSet.Page1[occuranceNumber].ButtonName. You will have to address each one individually to change it. The parameter you want is: buttonname.border,fill.color.value = "R value, G value, B value"
This is a case where FormCalc has an advantage because you can use the * in the occurance number to reference all occurances of the Button.
If you choose to use Javascript you will have to determine how many occurances of pageSet.Page1 there are then loop through each one using a for loop to get each separate ocurance and setting it one by one. Note that in javascript the [] are interprestted as an array index so you will have to use the cfa.resolveNode syntax like this (assuming i is the counter in your for loop):
xfa.resolveNode("form1.pageSet.Page1[" + i "]").ButtonName.border.fill.color.value = "255,0,0";