The District government has agreed to pay about $1 million to settle a federal class-action lawsuit brought by homeowners to stop tax-lien investors from taking homes in the city through foreclosure, attorneys for both sides said.