People usally think Magikarp as 'weak' despite being able to possibly do the things above. Magikarps got a decent speed stat as well for considered 'weak'
Magikarp has a base 80 speed which is mediocre at best.
Its only attacking options are tackle, bounce, and flail which are all going off of its base 10 attack stat. So yeah, its super weak xD
You usually can't do anything like this unless you are using a cheat or somehow manage to get a very dedicated baton pass team behind it.
Also, the only way it could have beaten half of Agatha's team (she doesn't use all ghost types) is if it just struggled the entire battle. Struggle hits ghost types.