NSW win as Queensland Test hopefuls fail