The Federal Highway Administration has told Massachusetts officials that it cannot support a politically potent Boston freeway project that, in effect, is holding hostage more than $7 billion in highway aid for the other states.

At issue is a $1.3 billion state plan to replace an elevated downtown Boston freeway with a depressed roadway, part of a $2.2 billion freeway-tunnel proposal that has the whole-hearted support of House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.).

The highway administration contends that highway legislation prohibits it from approving the project for maximum federal aid of 90 percent, which both Massachusetts and O'Neill want.

Congress adjourned last month without approving changes in the highway law that would have removed the highway administration's legal objections and freed hundreds of millions of federal dollars for Boston. The Reagan administration threatened to veto any highway bill containing special-interest projects and other members of Congress were unwilling to drop projects for their districts as long as the speaker's project remained in the legislation.

The result was that federal funds for interstate highway construction are collecting dust in the Treasury instead of being distributed to the states. Most federal highway money comes from a 9 cent-a-gallon gasoline and diesel tax.

In an internal memo to its regional office last week, the highway administration said, "we have determined that participation in this depressed roadway alternative would not be a prudent use of federal-aid highway funds . . . . It would have limited transportation benefits."

At the same time, the FHWA said it supports a Massachusetts proposal to build a related four-lane tunnel connecting downtown Boston with Logan International Airport. However, it said, funding for only a two-lane tunnel qualifies as part of the interstate highway system, a ruling that -- depending on several variables -- could reduce the amount of federal aid available for the entire project.

In the same memo, the highway administration approved Massachusetts' environmental impact statement for the combined projects, a required step before federal-aid construction can go forward.

Michael Shea, assistant transportation secretary for the state, took the optimistic view yesterday. "We interpret this, and our attorneys interpret this, as an approved environmental impact statement . . . . Some parts are disappointing, however."

Shea reiterated the Massachusetts view that it is entitled to 90 percent federal funding for the entire project.

O'Neill's office said that, "If Massachusetts players are in agreement, the speaker will support their approach."

Ray A. Barnhart, the federal highway administrator, said yesterday that "both practically and in principle the Congress has got to keep faith with the taxpayers." Barnhart wants the new Congress to free the money quickly.

Barnhart also attacked the proposed depressed freeway, saying "one shouldn't tie up the rest of the nation because of a desire to fund a substandard facility."