BEIJING—An environmental dispute involving a stone quarry in southeastern China marks the first test of a government effort to use the courts to help deal with a nationwide pollution problem.