NAIROBI, KENYA, NOV. 12 -- Members of a U.S. congressional delegation concluding a visit to Kenya tonight expressed optimism about this country's political future but warned that a recent decision to withhold a portion of U.S. military aid here will remain in effect until the Kenyan government takes steps to guarantee greater democratic freedoms.

"The U.S. cannot tell another country what it can and cannot do," said Sen. Patrick Leahy, (D-Vt.), chairman of the Senate subcommittee on foreign operations and the author of legislation that has linked $15 million in annual U.S. military aid to Kenya to an improvement in the country's human- and civil-rights record.

"But the U.S. has to make choices about how it extends help. . . . This is a clear expression of how we feel."

Kenya is the largest beneficiary of U.S. aid in sub-Saharan Africa, receiving $49.8 million in economic and military assistance this year. Kenya is slated to get $38 million in economic aid next year, but with the additional $15 million in military assistance withheld.

Those funds may be released once Kenya frees or charges all political detainees, ceases physical abuse of prisoners and restores the independence of the judiciary and freedoms of press and expression, according to Leahy. U.S. military aid to Sudan, Liberia, Somalia and Zaire has also been scrapped.

The government of President Daniel arap Moi has been under pressure from Western governments, aid donors and human-rights activists to allow greater freedom and more political parties in Kenya, which was rocked by riots this year that claimed more than a score of lives. Moi reacted to the disturbances by detaining numerous political dissidents and clamping down on press liberties.

Earlier this month, however, the government reversed a three-year-old policy under which all the nation's judges served at the regime's behest. Moi announced that his government would guarantee the judges' independence and security of tenure.

The five-member congressional delegation, composed of Leahy, Sen. Barbara Mikulski (D-Md.), Sen. Albert Gore (D-Tenn.), Rep. Mike Espy (D-Miss.) and Rep. Bill Richardson (D-N.M.), said the reversal on judicial tenure represented grounds for optimism.

Leahy said the group had met with Kenyan political dissidents who spoke of their desire for a return of the secret ballot here, he said. Currently, Kenyans have to make their votes known publicly.

The visit comes at a time when Congress has authorized a sizable increase in U.S. economic aid to Africa, from about $500 million a year to about $800 million.

Leahy said the increase reflected growing concern for Africa's problems. "I feel Africa has been neglected for too long. We spend as much on the tiny country of El Salvador . . . as we do in all of Africa."