Brazil moved to conclude the affair of the four Libyan planes detained a week ago while secretly flying arms to Nicaragua, but pilots of the planes obeyed orders to stay put today amid signs that the incident is far from over.

Brazil said the pilots could leave Sunday after Soviet, Czechoslovak and U.S.-made arms were unloaded during the weekend under tight military security. But the planes remained at the northern airports of Manaus and Recife and the Libyan Embassy expected the 38 crewmen to remain in Brazil several days.

Libya is still insisting that the planes return with the arms, which are being held for violation of the Chicago Convention on Air Transport. Brazil has refused, although President Joao Figueiredo's senior military Cabinet minister, Gen. Rubem Ludwig, said it was in Brazil's interest to return the arms "in the shortest time possible, either by plane or by ship." Officials said the cargo could be returned to Libya by a third country.

Press reports quoted other officials as saying Brazil might find it more convenient discreetly to return the arms to the countries of manufacture, without disclosing the complete inventory. Presidential spokesman Carlos Atila said only that ammunition, explosives and military spare parts had been found which were of Soviet, Czechoslovak and U.S. origin. No Brazilian-made weapons were founds, he said.

From the 52 tons of arms that Atila said were found, the energetic Brazilian press has deduced a prolific and varied arsenal, ranging from dismantled jet fighters through SAM missiles and multiple rocket launchers. Other reports quote officials involved in the unloading operation, from which the press was barred, as saying the arms were secondhand, outdated and in poor condition.

Unofficial reports say Air Force officials in Manaus unloaded up to three Soviet-made fighters as well as missiles and 90 mm heavy cannon. Some reports said up to 70 tons of arms were found in Manaus and 14 tons in Recife, where a U.S.-made Hercules plane carried cases containing 600 light artillery rockets. The Soviet jets are said to carry up to 40 tons each, the C130 half that.

In an account of the affair to leaders of the ruling party, senior ministers said yesterday that if Libya had been honest about the planes' real cargo instead of telling Brazil that medicines for Colombian earthquake victims were aboard, the planes would have passed freely.

Reports also quoted an unnamed Air Force official at Recife as saying Libya had made previous arms shipments through the airport. He said during last year's Falklands conflict, three Buenos Aires-bound Hercules planes carrying arms made refueling stops at Recife and Rio de Janeiro. (Argentine Gen. Leopoldo Galtieri, who was president at the time, has acknowledged receipt of three planeloads of Libyan arms.)

Libya's and Brazil's foreign ministers have exchanged letters and the risk of a diplomatic rupture appeared much reduced. Brazil has bought oil from and sold arms to Libya.