Judge rejects Rocky Hill mine near Gloucester, NSW, because of its impact on the town and ‘dire consequences’ of increasing emissions