WITH most of its troops and tanks surrounded with no hope of resupply, the Yugoslav Army yesterday agreed to withdraw its forces to their position in Slovenia before the Slovenian declaration of independence last week.The main point left to negotiate is whether or not federal troops keep their weapons - not a small point given the pride of the Serbian-led Army. The agreement, made by Yugoslav federal Prime Minister Ante Markovic when his generals refused to negotiate, appears to be a victory for the tiny breakaway republic and its president, Milan Kucan, who only days before described the battle he faced with the far superior Yugoslav Army as "a David-and-Goliath situation." It is also a blow to the authority of the federal government, which has three republics in the process of separation, a budget heavily dependent on Western aid, little popular support, and an Army that for the last two days has made decisions independent of federal authority in Belgrade. Mr. Markovic said after a meeting here on Sunday that the conflict in Slovenia must end in order to avoid a "Lebanonization of Yugoslavia." The federal troop withdrawal marks another in a series of rapid changes in this conflict, which on Sunday had citizens of the capital grimly scurrying underground, following the sound of planes overhead and an air-raid alert. Yet analysts now say the jets taking off from airfields around the Croatian capital of Zagreb Sunday were a form of psychological warfare, since a strike on Ljubljana would have brought retaliation against federal troops surrounded in the countryside by the Slovene territorial defense forces. Reports from the field yesterday painted a picture of a federal Army confused from the start. Federal troops began their operations last Wednesday night with almost no resupply, indicating they expected little resistance. Nor did many of the soldiers know the terrain. The lead tank in the column taking the Brnek Airport on Thursday was the only one that knew the way, captured soldiers told reporters. Moreover, as their tanks and trucks were blockaded at Slovenian border posts and other targets, the feder al troops quickly went through their food and water supplies. "Militarily, this was an effective blocking strategy," says University of Ljubljana military expert Anton Debler. "Their troops were in a desperate situation. The operation was poorly planned, poorly managed, the logistics were nil, the objectives unrealistic. The Army surrendered because it had no choice." The commander of the federal forces at Brnek told reporters he would rather fight than surrender, but "had to think of my 18-year-old boys." Such sentiment was also evident in the Serbian province of Vojvodina Sunday, when several thousand soldiers' mothers gathered on the town square at Novi Sad to plead that their sons not be allowed to starve. What worries some observers here is the new "hard-line" position taken by the Slovene authorities in their negotiating positions - characterized by the request that the federal troops withdraw without arms. Some say such tactics could lead to retribution later. 'I'd be very surprised to see the Army give up as completely as they've seemed to. The Army now seems to be re-forming around the strong Serbian element," says Bostjan Zupanic, a constitutional scholar and vice chancellor of the University here. Still to be concluded are crucial negotiations on how the borders of Slovenia are to be guarded - by federal or Slovenian police. Whether or not the Yugoslav government can recover from this crisis is a main question in the coming weeks. Many observers here feel it is too late. Part of the "constitutional crisis" Yugoslavia has been facing because of the blockage by Serbia of Croatian delegate Stipe Mesic to the eight-member rotating presidency last May has been mitigated by the European Community delegation that met in Belgrade and Zagreb Sunday. The EC delegation achieved a written agreement codifying a three-month freeze of the Slovenian and Croatian declarations of independence; the election of Mr. Mesic in Belgrade, albeit to an office severely weakened in recent days; and the withdrawal of federal troops in Slovenia to their barracks. German Foreign Minister Hans-Dietrich Genscher was due to fly to Yugoslavia yesterday as chairman of the new crisis mechanism body of the Conference on Security and Cooperation in Europe.