A tough loss to Spain means Australia will face a challenging task in the quarter-finals to end a 21-year title drought in the team competition.