LAST week, for the first time since the financial crisis, the government faced off in court against a major bank over lending practices during the mortgage mania. Lawyers for the Justice Department contend that Countrywide Financial, a unit of Bank of America, misrepresented the quality of mortgages it sold to Fannie Mae and Freddie Mac, the taxpayer-owned mortgage finance giants, starting in 2007. Fannie and Freddie incurred gross losses of $850 million on the defective loans and net losses of $131 million, the government said.

Bank of America disagrees. Its lawyers say that Countrywide did not defraud Fannie or Freddie.

This case is undoubtedly big, but it is only one of many mortgage-related matters inching through the judicial system. And what is notable about some of the lower-profile matters is the tone and tack that federal judges are taking in their rulings. District court judges are not generally known as flamethrowers, but some seem to be losing patience with the banks.

For decades leading up to the foreclosure debacle, plaintiffs’ lawyers say, judges generally took the side of lenders when borrowers came to court complaining of problematic lending or predatory loan servicing. Many judges still do. But some are getting tough, perhaps having seen too many examples of dubious bank behavior.

“Maybe the judges are tired of the diet of baloney sandwiches the banks have been feeding them,” said April Charney, a foreclosure defense lawyer who for years represented troubled borrowers at Jacksonville Area Legal Aid in Florida. She is now in private practice.