Congress has sent President Reagan a bill that once again would make agencies liable for attorneys' fees and other costs when individuals and small businesses win legal battles against unjustified government actions.

The Senate passed the bill, 95 to 2, on Wednesday and sent it to the White House, where Reagan is expected to sign it despite having vetoed a similar measure last year.

The bill would extend the Equal Access to Justice Act, which expired on Oct. 1, 1984, when Reagan vetoed the earlier bill.

Sen. Charles Grassley (R-Iowa) said the bill was needed because those subjected to unfair actions by agencies often face "a Hobson's choice" in deciding whether to fight it in the courts or through administrative procedures.

In many cases, he said, it may cost more to pursue a legal battle than to pay a fine that was unfairly levied by an agency.

The legislation would make permanent a three-year test program. Reagan had vetoed the earlier version of the bill on the ground that some provisions were too broad and could lead to lengthy discovery by lawyers seeking to learn how government positions were reached.

But Grassley said the new version would not allow such "fishing expeditions" and now has the support of the Justice Department and the Office of Management and Budget.

"Thus, we are sure the president will sign it," he said.

The benefits of the legislation would be limited to individuals with a net worth not exceeding $2 million and businesses with a net worth not exceeding $7 million.