Mercenaries would do pretty much exactly what their contract allowed. If the contract included a clause that allowed the unit, or individuals, to withdraw their services if they were asked to participate in atrocities, they might, particularly if the bulk of their contracted payment had cleared, or if the down payment had cleared and the ticket looked like a mess in the works. Their contract might even include a clause allowing withdrawal if the unit were asked to stand by while allied forces committed atrocities.
In some regions, such clauses might even be required for a mercenary unit to be licensed for recognition as a legal mercenary force. In that case, there might still be a few rogue units that tolerate atrocities, and there would always be bloodthirsty individuals who participate in atrocities just because they are horrible people.
But no professional mercenary force would flip sides or even withdraw from a conflict except under the terms of the contract, unless they had solid evidence of an unacceptable situation that had been neglected to be mentioned in the contract. (And that situation, no matter how obscure, would soon turn up in their future mercenary contracts, as well as those of their fellow mercenary companies, making the contracts progressively more bulky and loaded with legalese.) Flipping sides, or withdrawing without good reason, will ruin a reputation, and is likely to lead to captured mercenaries being killed rather than released on repatriation bond.