I’d try to talk with them each, separately, outside of rehearsal, before the next blow-up happens. Since you think they’re aware that this isn’t a good situation, ask what their solutions would be on how to work through their differences less publicly. Maybe they can agree to exchange written notes instead of discussing things during rehearsals, or plan to hold their notes to the end and talk then in private. Maybe the three of you could have a code word or gesture that you can use if they’re in front of others and begin to raise their voices, if they’ll agree that on your single they’ll get back to business and save the rest of the argument for another time. You could also talk about how their negative energy affects those who are around them, and in the interest of keeping things positive, you’d like to call a break if you sense things are getting heated. Perhaps there is another neutral party they both respect, who is involved with the production or theater, and could mediate in some way.
Some personality conflicts are just beyond the SMs ability to solve. If that’s the case, I’d do my best to stay in touch with actors and crew, to lighten their mood as much as possible. You can at reassuring them that the director & producer have personal differences, and this isn’t about the quality of the show or anyone in it.