Washington — A compromise plan authorizing the President to keep US marines in Lebanon for 18 more months is moving on a fast track and will probably win final passage in both houses of Congress this week.
But the thin fabric of the agreement only partly conceals deep doubts on Capitol Hill about direct American involvement in Mideast fighting.
Those doubts surfaced in Technicolor for a few dramatic minutes Friday when the entire compromise almost disintegrated in the hands of the Senate Foreign Relations Committee.
Two weeks of painstaking negotiations steered by Senate majority leader Howard H. Baker Jr. was ''going down the tubes,'' the Tennessee Republican said, after the committee voted 9-8 on a preliminary motion to limit US troop involvement to six months.
Sen. Charles McC. Mathias Jr. (R) of Maryland, who since early this month has been pushing for a six-month limit, had sided with the Democrats to give them a majority. A visibly distraught Senator Baker sank in his chair and then made a plea to the straying Republican.
With the fate of the compromise hanging in midair, Senator Mathias backed down: After about 10 minutes he moved to reconsider the question, and then sided with his party to approve the Baker proposal. Tension in the room relaxed. Mathias switched, he explained later, because he saw the whole effort to resolve the Lebanon question was ''unraveling fast.''
Although the agreement on Lebanon escaped intact from committee, it faces a long and probably heated debate on the Senate floor on Wednesday. Democratic senators, who have never signed onto the Baker compromise, can be expected to argue that the Reagan administration has no realistic objectives in Lebanon.
''There's no reasonable prospect to achieve its stated goal,'' says Sen. Joseph R. Biden Jr. (D) of Delaware, citing that goal as the securing of the central government of Lebanon and the removal all foreign troops.
But what seems to rankle Democrats the most is that Secretary of State George P. Schultz has told Congress that the President does not recognize congressional limits set on troop movements. Sen. Paul S. Sarbanes (D) of Maryland told the Senate committee: ''It is clear that the administration is taking the position that regardless of what the authorization (passed by Congress) states in terms of time period, purpose, and numbers, the President is reserving . . . a constitutional authority to go beyond it.''
If the Baker compromise prevails this week, it will be partly because most members of Congress concede that the United States should not hastily pull its troops out of Lebanon. Also, the agreement does invoke the War Powers Resolution of 1973, which requires the president to have congressional authority to keep troops in hostilities for more than 60 to 90 days. Even if the President says he will ignore those limits, his signature on the compromise would mean something, say some members of Congress.
''It's a good precedent,'' says Rep. Jim Leach (R) of Iowa, a frequent critic of Reagan foreign policy, because the agreement gives ''legal sanction'' to keep troops abroad, while spelling out some limits.
Democratic Rep. Les Aspin of Wisconsin warns that House members are so undecided that it is impossible to predict the outcome of the vote. He says some members argue one side on one day, and switch the next.
''I've not made up my mind,'' he says. ''My guess is, yeah, the 18 months is going to pass. It's the best of lousy alternatives.''