Bank regulatory agencies were accused yesterday of not vigorously enforcing anti-redlining laws and legislation that would require leaders to compensate victims of credit discrimination was urged.

Red-lining is the practice of refusing to grant mortgages or insurance in designated geographical areas, especially inner cities.

At a House oversight hearing, Massachusetts commissioner of banks Carol Greenwald - an outspoken supporter of consumer rights - called the agencies' methods of examing the underwriting procedures of lending institutions "a mockery of enforcement. It is the equivalent of assuming that if we check to ensure that all the traffic lights in a city are operating, no one will go through a red light."

In her state, examiners found nearly three times the number of procedural violations reported by the Federal Deposit Insurance Corp. Federal examiners, Greenwald testified, rely on perusal of loan applications and the banks' word they havenot discriminated. She urged that applications be analyzed by computer for more accuracy. The date should be compared with the racial composition of census tracts where the institution would be likely to make loans.

However, Greenwald added, checking loan applications does not reveal the extent of red-lining because many would-be borrowers are refused before they even make out a formal application. For example, a Boston bank reported no loan applications from Roxbury, a predominantly black section, and other areas with 30 percent or more minority composition. Yet the bank serves communites all around Roxbury.

In 1976 only 20 percent of the houses sold in that section had bank financing; in 1977, only 32 percent. Buyers were obliged to go through mortgage companies charging higher rates or to have the sellers take back the mortgages.

To detect cases where borrowers are discouraged from making an application the bank commission relies on "testers", minorities and women posing as customers seeking loans. Federal agencies disdain the use of testers. Thus far, only one of them, the Federal Home Loan Bank Board, has taken major steps to stop red-lining. The committee is trying to find out why, and to determine how enforcement could be strengthened.

Ellen Broadman of Consumers Union and William L. Taylor of Catholic University Law School's Center for National Policy Review, joined Greenwald in calling for actual and even punitive damages for victims. Under current law, a person must sue a bank to recover damages. The agency merely tells the bank to stop discriminating and grant the loan.

The consumer witnesses proposed that leaders guilty of credit discrimination be required to pay the difference costs between a loan that was refused and one that was granted at higher interest rate. For a Boston woman, this meant at cash settlement of $2,500, the difference between 9 and 9.25 percent interest on a $41,400 loan of 25 years.

These witnesses termed the guidelines for enforcement, issued by the agencies 1st June, "weak" and "vague". The guidelines were adopted as a result charged the agencies were treating fair housing and equal credit complaints differently. Taylor singled out the Federal Reserve as the most hesitant to enforce anti-discrimination laws.