The Teamsters union claimed a two-vote victory last night in its hotly contested election drive to oust the union that for 30 years has represented the 2,300 employes of the District's troubled prison system. But 32 disputed ballots left the outcome uncertain.

With more than a 70 percent voter turnout among D.C. Department of Corrections workers, the Teamsters led the American Federation of Government Employees by 752 to 750 -- but 32 challenged ballots were not opened and could swing the vote to the AFGE.

An arbitrator to be named by the American Arbitration Association was to rule as early as today on whether the 32 contested ballots should be opened.

But the Teamsters contended that the votes are invalid in any case because the names of those who voted did not appear on a master list of eligible employes distributed to both unions.

"We have won. These workers have spoken," Ernie V. Jumalon, secretary-treasurer of Teamsters Local 246 declared after the two-hour vote count at the AAA's downtown headquarters.

AFGE organizing director David Kushner countered the claim, asserting that "you can't declare a victory until a union election is certified -- and this is not certified."

A legal challenge was considered likely by either side after a ruling on certification is issued by the D.C. Public Employee Relations Board.

If upheld, the victory would be a significant one for the 1.9-million-member Teamsters because the union has been making a major push to expand its membership among public-sector employes. The union currently represents Metro transit and security police, but has not made any inroads among Washington area government workers.

The loss also would be a major setback for AFGE, an AFL-CIO affiliate which represents 7,700 District employes but stands to lose its largest unit in city government and therefore would have its political influence in city affairs substantially diminished.

The outcome also will determine whether Mayor Marion Barry's administration, which has previously bargained only with AFGE, will have to deal with a new and historically aggressive union at a time when prison issues have become politically volatile.

Jail crowding, low wages and poor and dangerous working conditions were among the key issues in the hard-fought election campaign at D.C. Jail, Lorton Reformatory and other corrections facilities.

The Teamsters brought in organizers from as far as Detroit in their campaign to persuade employes they could more effectively pressure the Barry administration for changes.

"The real issue in this close vote is that the workers are screaming for changes, and they want to see progress," said AFGE political organizer Bernard Demczuk.

"In a sense, this vote says they are asking both unions to represent them fully and aggressively," Demczuk said.

After the long vote count in a smoke-filled room crowded with union officials and ballot counters, Donald H. Weinberg, the city's chief labor negotiator, declared that "we cannot resolve this election tonight" because of the 32 challenged votes.

The election was prompted by widespread dissatisfaction with AFGE last year, when more than 1,000 corrections department workers petitioned the city employe relations board to leave AFGE and instead join the Fraternal Order of Police or the Teamsters.

An election Feb. 19 resulted in AFGE receiving 48 percent of the vote, forcing a runoff with the Teamsters because, under city law, a majority vote is required to win union recognition.

The Teamsters received only about 28 percent of the February vote but made a surprising comeback yesterday.

AFGE Local 1550 had been in such disarray last year that its 200,000-member national union, citing "mismanagement" and ineffectiveness by local officials, placed it in trusteeship and assigned AFGE headquarters staff to a salvage effort to restore the union's position.

The Teamsters campaigned on the claim they would take a stronger bargaining position than AFGE, partly because of different structures of the two unions. The Teamsters rely heavily on outside "business agents" to handle employe grievances and other disputes, while AFGE in the past has used its own members, elected by coworkers, to perform many such functions.

Teamster officials said AFGE members, who work inside the corrections department, are more easily intimidated by supervisors during work place disputes.

AFGE had pledged during the election campaign to use more outside business agents and to take a more assertive stance in its dealings with the Barry administration.

AFGE has recently played a more assertive role, holding several demonstrations at jail facilities, lobbying for City Council hearings on prison conditions, and filing a lawsuit last week in D.C. Superior Court aimed at reducing crowding on the grounds that it threatens guards' health and safety.

AFGE also has prodded the Barry administration to conduct a "pay parity" study aimed at showing the need for pay raises for corrections officers, who earn between $15,000 and $21,000 base pay annually, plus overtime.

The District prison pay scale lags far behind area law enforcement and corrections agencies, the union said.

AFGE also had countered Teamsters criticism by portraying the larger union as corrupt and money-hungry, pointing to the criminal convictions of past Teamster presidents, and highlighting the $500,000-plus salary and additional benefits of Teamster chief Jackie Presser.