"A missile can take down ONE attacker. If the enemy attacks with a wave of drones then the available supply of missiles will be exhausted very quickly leaving the vehicle with no protection."
That's currently one more than a not yet existing railgun that will be highly unlikely to effectively scale to APC level. Even if a ground vehicle railgun did come into being, it would still suffer from the same ammo limitations. Okay railgun slugs would take less space than missiles, but now you need something in the vehicle to power the accelerator.
Also if the railgun projectile is to be launched at speeds that make it worth using a railgun instead of an old school decent calibre cannon, the air disruption at launch would likely pose a serious threat to nearby infantry if not the vehicle itself.