It is virtually impossible to totally isolate the battle area.
Thus, even with the Ark of the Covenant present in the battle area, they lost the battle and were slain.