A mortgage lender has agreed to a $20 million settlement to resolve claims of redlining in the greater Philadelphia area.