I assume that the "breach of treaty" (I hadn't thought about that, embarrassingly enough) would only be in the event that one makes peace before the 20-turn MA expires?
Yes, as Lanzelot says. The 'good' news, though, is that the AI-Civs seem to have no problem with breaking (most*) 20-turn deals themselves, which has 2 implications:
(1) Don't pay up-front goods (techs, lump-sum gold) for any MAs if you can possibly avoid it!
(2) If you've accomplished your war aims relatively smoothly/early, and can hold out easily against any further counter-attacks, you won't necessarily have to wait the full 20 turns before the MA is cancelled, allowing you to sign peace yourself.
Also, bear in mind that even if you
do have to let an MA run the full 20T (e.g. because it takes that long for your ally and your enemy to whittle each other down), cancelling it immediately on Turn 21 won't in itself necessarily end your ally's war — not even if you then also sign a PT with your mutual enemy. Once 2 AI-Civs have been at war for 20 turns — and especially if they share a land-border — they'll likely be so Furious with one another that they'll carry on fighting even without your further encouragement, until one of them obtains a sufficiently decisive advantage over the other, as to be able to force substantial peace-treaty concessions (or destroy the loser outright). And as long as they're fighting, they will both revolt to/ stay in a non-WW government, slowing down their economies relative to yours — which is rarely if ever a bad thing.
*Apart from Trade Embargoes, which seem to last the full 20 turns if not longer, because the AI-Civs often don't seem to require any payments for these (certainly
I've made TEs without having to pay anything for them, even at Emperor level, so it seems reasonable to assume that TEs between AI-Civs cost even 'less' than that...)