The Agrius didn't actually take out Midgardsormr. Midgardsormr took out the Agrius, but got too busy gloating while coiled around it. The ceruleum tanks then exploded, taking ol' Middy with them. Why Midgardsormr intervened hasn't been explained; we do know that he is an agent of Hydaelyn, but why She would send him to fend off that particular Imperial invasion nobody knows yet.

... but, given the Agrius couldn't defeat Midgardsormr, it... probably couldn't take out Bahamut.