The Senate yesterday overwhelmingly voted to repeal a five-year-old ban on military assistance to the Pinochet government of Chile, handing the administration another victory in its effort to improve ties with military regimes in Latin America.

The vote would give President Reagan qualified power to resume arms sales and other military aid to the Chilean government for the first time since critics succeeded in banning it because of that country's human rights record.

The Senate soundly defeated an effort by Sen. Edward M. Kennedy (D-Mass.) to keep the ban on arms sales in place. He argued that torture, detentions, and harassment of dissenting Chileans are still practiced by the government of President Augusto Pinochet.

Late last month the Senate voted to repeal a similiar 1978 ban on arms sales and aid to Argentina.

The Senate last night passed the $5.8 billion foreign aid bill after three days of debate, by a vote of 40 to 33. It includes funds for both military and economic assistance to both Israel and Egypt and military aid to South Korea, Greece, Spain and Sudan.

The House Foreign Affairs Committee has approved a bill similar in many respects, but it must now be reexamined in the light of the Senate action Wednesday requiring a cutoff of assistance to any currently non-nuclear country which explodes a nuclear device. House sources yesterday said that might be considered either on the House floor or in a later conference with the Senate.

Chile dominated the debate yesterday, with the senators voting, 86 to 0, to approve an amendment by Sen. Charles H. Percy (R-Ill.) to repeal the ban on military assistance. A compromise measure, the amendment stipulates that the president cannot resume the aid until he certifies that Chile has made "significant progress in complying with internationally recognized standards of human rights." The president also would have to state that the assistance would be in the national interests of the United States.

The Reagan administration has not requested any funds for reviving aid to Chile and there was no indication yesterday that it would do so soon.

Sen. Jesse Helms (R-N.C.), who an aide said was working in "consort" with the administration, first called for outright repeal of the prohibitions. He said the restriction had not helped the victims of human rights problems in Chile and had "penalized" the American economy because other countries sold weapons that American businesses were prohibited from selling because of the law. He also claimed that human rights violations in Chile have decreased since 1977.

Kennedy, who had sponsored the original ban in 1976, lost on a vote of 30 to 57 an effort to table Helms' repealing amendment. By an agreement reached before the vote, Percy then introduced his compromise which passed unanimously.

Kennedy contended that human rights violations continue in Chile and said that an American resident had been arrested and tortured there six months ago by government agents seeking to obtain information on Chilean dissidents here.

Kennedy also cited the case of Orlando Letelier, the former Chilean ambassador who was assassinated in Washington in 1976. He said the Pinochet government had refused to cooperate in the prosecution of three former Chilean security officials who allegedly planned that assassination. Repealing the ban on military assistance, Kennedy said, would condone a new round of "terrorism" by the Chilean government.

The Senate also added a bit of support to the administration's criticism of a group of non-aligned nations which last month issued a communique sharply critical of U.S. policies. About 40 of those countries were sharply criticized by U.N. Ambassador Jeane J. Kirkpatrick for using "vicious and erroneous" language against the United States in their communique.

Sen. Daniel Patrick Moynihan (D-N.Y.) joined the argument yesterday with an amendment to the foreign aid bill that would have cut off aid to countries which did not dissociate themselves from the communique. He abandoned that amendment for a mild version which merely calls on the president to consider whether, in deciding on giving American aid, the country has dissociated itself from the statement. It passed, 88 to 0.

"When one is a donor, one has a reasonable expectation not to be vilified," Moynihan said.

Earlier, the Senate rejected, 39 to 48, a bid to prevent the Peace Corps from being separated from the Action agency. The Foreign Relations Committee had proposed giving the Peace Corps independent status on grounds that its recruiting was hindered by its affiliation with Action.