That's not how Swift Swim works. At all. It doesn't double the base stat, but rather the actual stat. Timid Mega Alakazam with maximum Speed EVs reaches a Speed stat of 438. Adamant Mega Swampert with maximum Speed EVs reaches a Speed stat of 239, which when doubled becomes 478.Alakazam Mega base speed is 150 and Mega Swampert base speed is 70 (140 in rain), so Mega Alakazam will outspeed Mega Swampert.
My guess as to what happened is that the Swampert had less than 172 Speed EVs, probably so it could invest a bit in bulk.