As thousands of somber Ecuadorans gathered quietly in the sunshine outside Quito's international airport yesterday morning, the pale gray casket containing the body of President Jaime Roldos was carried out of the airplane that had brought him back to Quito.

Only the rumble of the white escort motorcycles broke the silence as dark-suited pallbearers, their faces straining with the weight, lifted the casket onto a large jeep that had been draped with purple velvet. Behind them came the caskets of Roldos' wife Martha, Ecuadoran Defense Minister Gen. Marco Subia, Subia's wife, and five other Ecuadoran military men -- all killed Sunday afternoon when their light plane crashed in the mountains near the Peruvian border.

A military band began a melancholy rendition of the Ecuadoran national anthem as the jeeps headed out of the airport and into town, past weeping women in dark sweaters and skirts, past plaid-skirted uniformed schoolgirls with their hands over their hearts, past young men in track suits who stood stiffly at attention as the caskets passed, past Indian women in dark broad-brimmed hats who gazed up at the caskets and raised their hands slowly to wave.

At 40, Roldos was the youngest president in Latin America, a personally well-liked but politically troubled leader whose popularity had begun to plummet in the last few months. Since the beginning of the year, the president had been faced with a costly and fruitless border war against Peru, a one-day general strike that nearly shut down Quito, growing economic problems, and rumors that the military was preparing to retake power. The day he died, Roldos had entered the crowded Quito stadium to decorate soldiers who had fought in the conflict with Peru -- and for the first time since his election, Ecuadorans had whistled at him, which is the South American way of booing a public figure.

With Ecuador only a year and a half into civilian democracy after nine years of military rule, the president's death could scarcely have come at a more difficult time. "This is the supreme test of the viability of democracy in Ecuador," said a diplomatic observer. "[President Osvaldo] Hurtado has the legitimate right to assume the presidency, but will his legitimate right be recognized, because he does not have the popular mandate to carry out policy?"

Hurtado, a 41-year-old economist who was elected vice president when Roldos won the Ecuadoran presidency by a landslide in April 1979, is said to be a highly intelligent, articulate pragmatist whose politics will probably be somewhat more left of center -- stressing social programs such as rural development -- than those of his predecessor. Although during the election Hurtado belonged to the Concentration of Popular Forces, Roldos' party, Hurtado was one of the founders of Ecuador's Christian Democrats. After the election, Hurtado became affiliated with a Christian Democrat offshoot party called Popular Democracy.

Traditional Christian Democrats, such as the current leaders of Venezuela, are said to be somewhat leery of Hurtado because of his reputation as a left-of-center politician. There is also believed to be uneasiness within the business community here, both national and foreign, particularly because during Hurtado's vice-presidency he was able to maneuver political associates into key economic positions.

Hurtado has written a number of books, including one much-discussed study some years ago of the great economic disparity in Ecuadoran society, where it is still estimated that fully half the population is unemployed or underemployed, making less than the minimum wage of $160 per month. His most recent book, "Politics in Ecuador," was recently translated into English.

If Ecuador's constitutional democracy is now threatened -- and at least until the eight-day national mourning period ends, it will be difficult to tell whether it really is -- the threat comes partly from Hurtado's lack of strong, evident support from any sector outside his own relatively small political party. "The right sees him as being very leftist," said the diplomat. "The left sees him as being too much of the intelligentsia, and a snob."

The new president is inheriting an administration beset by economic and political problems. Petroleum, which has been Ecuador's most important export ever since oil was discovered in the Amazon basin in 1972, is flowing from the ground in gradually decreasing quantities. At the same time, domestic consumption is growing by 10 percent a year.

The agricultural sector, which is immensely important to this country of 8 million people, is also floundering. International prices have dropped for cacao, bananas, and coffee, Ecuador's main agricultural exports. And internal production has declined.

The most frequently heard criticism of Roldos was that however well-intentioned he might be, he remained in a kind of paralysis before those problems. When he did act last February, releasing a 21-point economic program that included higher food prices and a 300 percent increase in the price of Ecuador's cheap gasoline, his efforts were met with outrage that culminated in the May 13 general strike by blue-collar and transportation workers.

Government officials said today that they were investigating the cause of Sunday's plane crash. An anonymous caller to the Colombian newspaper El Tiempo yesterday said the April 19 movement was taking credit for the crash as retribution for the Ecuadoran government's return of a large group of M19 guerrillas who had fled across the Ecuadoran border. There have also been other rumors of possible sabotage, none yet taken very seriously.

Roldos was buried this morning in the warm coastal city of Guayaquil, where he and his wife grew up.