Activists have lost their court bid to prevent gas exploration in the Northern Territory after claiming fracking would contaminate groundwater resources.