The Cuban government tonight announced an agreement with the United States, through intermediaries, for the return by air of Cubans killed and wounded in this week's fighting in Grenada. As soon as fighting halts, other prisoners are to be returned by ship.

According to a communique, the United States will allow the International Committee of the Red Cross to evacuate an unspecified number of dead and wounded to Havana on a Swissair plane "within the next few hours." Other sources here indicated, however, that the actual return may not occur until Monday.

The Cuban government has not given estimates of the dead or wounded, saying that only the U.S. invaders could have the figures.

According to the Cuban account, Colombian President Belisario Betancur told Cuban President Fidel Castro that in contacts today U.S. officials covered three points:

* The United States agreed in to provide guarantees for the transportation of the dead and wounded.

* The release of the unwounded prisoners was impeded by shooting in the hills near the dock where a British ship is ready to evacuate them. The Americans said that as soon as the shooting ended, the prisoners would be transferred to the ship.

Betancur said that the Americans claimed that Cubans and "other Europeans" were responsible for the shooting.

* While the Cuban government has complained that the United States has been unwilling to make contact with Cuban Ambassador to Grenada Julian Torres Rizo, the American side said today that contact with him can be made "more expeditiously" when military activities end.

A member of the State Department's working group on Grenada said it had no immediate information on the reported agreement.

Cuba previously had said its freighter Vietnam Heroico was near Grenada and could pick up the prisoners, but Betancur was quoted as saying the U.S. side rejected this, saying the ship carried "special weapons."

Betancur reportedly told the U.S. side that his government and Spain's are willing to send representatives to Grenada to mediate with the Cubans there for the release of the prisoners.

According to the transcript of the Betancur-Castro conversation, Castro asked the Colombian and Spanish governments to mediate the release of members of Grenada's ousted revolutionary government held by U.S. forces.

Cuba's account quoted Spanish President Felipe Gonzalez as telling Castro that the United States was considering the possibility of putting certain Grenadan revolutionary leaders on trial.

"Independently of Castro's total disapproval of the events that led to . . . deposed prime minister Maurice Bishop's death . . . all Grenadan revolutionaries should be granted protection," the Cuban statement said.

Earlier, Edward Cody of The Washington Post Foreign Service reported from Bridgetown, Barbados:

A Cuban diplomat here countered previous U.S. contentions that there was a total of 1,100 Cubans in Grenada at the time of the invasion. The official, Ambassador Ivan Cesar Martinez, declared that 784 Cubans are on Grenada, 22 of them military advisers. He said that U.S. reports of several hundred Cuban combatants holding out against American invasion forces are "absurd."

Martinez's comments came before word that Pentagon officials in Washington had revised their estimates to numbers closely approximating those offered by Havana, and that agreement appeared to have been reached between Cuban and the United States on the return of Cuban prisoners.

The newly announced agreement appeared to apply initially only to an unspecified number of wounded Cubans. This afternoon, Martinez accused U.S. military officers on the embattled island of refusing to cooperate with Havana's efforts to repatriate the 638 unwounded Cuban prisoners said by the United States to be in custody. He said Cuban Ambassador Torres Rizo in Grenada has not received an answer to entreaties to U.S. commanders at their Point Salines headquarters.

Martinez's statements, made in a news conference, also appeared designed to refute charges by the Reagan administration that the invasion cut short a Cuban plan to turn the 133-square-mile island into a military outpost in the eastern Caribbean.

"The Americans see Cubans behind every tree and stone," said Martinez, a Havana-based ambassador accredited in Barbados and Trinidad and Tobago.

He declared that weapons stores found in sheds near the airport were Grenadan militia arms supplied to Cuban airport workers by the late prime minister Maurice Bishop in case of an attack, which he recalled Bishop and his government had predicted repeatedly since coming to power in a coup d'etat March 13, 1979.

Cubans working at the airport were civilians but had received training in the use of light weapons during service in Cuba's own militia, he added.

"They are real construction workers, but as you know, because of 25 years of threats against Cuba, all our people receive basic military training through the militias," he said. "If you will, they were militia men, like any other Cubans." Martinez specifically denied that the workers belonged to Cuban Army engineering units similar to squads that have been sent to Nicaragua to assist in construction projects.

Reading from a list, he said the Cubans in Grenada include 636 construction workers, most assigned to the Cuban-financed airport project; 17 doctors and health aides; 12 teachers and professors; six agriculture advisers; six transport advisers; six economic advisers; five fishing advisers; three metallurgy technicians, and three cultural advisers.

He also listed two domestic trade advisers; one communications technician; one foreign trade adviser; one sports adviser; one economic planning adviser; nine advisers in the Interior Ministry, apparently security specialists; 22 military advisers; 21 Army interpreters and administration aides assigned to the military advisers, and 12 Cubana Airlines crew members.

In addition, he said, Col. Pedro Tortolo of the Cuban Army and Carlos Diaz of the Cuban Communist Party Americas department were on the island on a one-day mission to instruct airport workers not to engage any invasion troops in battle unless attacked, but to fight "to the death" if assaulted.

Martinez said the list also includes Torres Rizo and 17 other embassy personnel and dependents.