The state and two companies want a judge to toss a lawsuit alleging they violated residents’ right to clean air, water and a healthy environment.