Voters in Western Australia, Queensland and the Northern Territory have ousted Liberal governments in state elections.