Great question! The answer, unfortunately, is not quite clear to me yet.
Dunash ben Labrat (the author of this piyyut, 10th century Moroccan educated in Baghdad) is using the Biblical text of Isaiah 63:1-3, which speaks of Botzra and Edom.
Mahzor Vitri (11th century French liturgical manuscript) has Edom (and this is also the version on piyut.org). Elizer Weisfish suggests that Edom is the original version, but points out that in rabbinic literature Edom and Bavel are sometimes interchangeable terms for 'the enemies of Israel' in general.
However, R. David Yitzhaqi, in Tzefunot 6, points out that in the metre of Andalusi Hebrew poetry, Edom is a short-long foot (because of the hataf-segol), where the metre in this line calls for a long-long foot (like Ba-vel). In lay terms, Edom doesn't actually fit the metre of the poem but Bavel does, so it seems that Bavel is the original version. In my opinion, semantically Bavel also makes sense because of the 'vegam' ["and also"] connecting the two halves, which makes more sense if the first half is Edom/Botzrah, and the second half is Bavel. Unless Dunash is punning on the name of Basra, in Iraq, in which case saying "Botzra (i.e. Babylonia) and also Edom" makes more sense.
Whoever wrote this here noted that Iraqi Jews sing "Edom" and not "Bavel", and the version on the Iraqi Beit Knesset Eliyahu website also has "Edom".
So the short answer is, without going to the library, I can't seem to find a definitive answer. It seems probable (certainly possible!) to me that Bavel was the original version, as you said, and it was changed in some places to Edom. However, the opposite is also possible! The fact remains that there are variant versions, and the preference of one over the other likely has to do with censorship of some sort, whether it's Edom replacing Bavel or vice versa.