Perth all but certain to lose Ashes Test