Back-to-back defeats to Australia and Afghanistan guaranteed a group-stage Champions Trophy exit for England.