The prime minister’s coalition suffered a second state election defeat in just three weeks