Insurgents made inroads into the Teamster Union hierarchy in St. Louis, and the Boston area in local elections over the weekend. But they lost a major contest in New York.

The mixed outcome of the voting represented gains for the small dissident movement within the 2.2-million-member union, although it stopped considerably short of the insurgents' hopes for a major breakthrough.

In the most widely publicized of the internal union elections, officials of New York's Local 282 won by a roungly 4-to-3 ratio over a slate of challengers allied with the Professional Drivers Council (PROD), a national group of Teamsters dissidents.

Reelected as head of the 3,000-member union, one of the most powerful in New York, was John Cody, who is the focus of a federal antiracketeering investigation. Cody complained he was a victim of government harassement and at one point suggested he might be indicted before the vote.

Another dissident group, the Teamsters for a Democratic Union (TDU), did better in St. Louis, Mo., and Lynn, Mass.

In St. Louis, TDU member Floyd Atchison was elected secretary-treasurer of 1,300-member Local 604, giving dissidents the effective control of two of the three largest car-hauling locals in the union. They won control of the second-largest, in Flint, Mich., last month.The largest is in Detroit.

In Lynn, Mass., Frank Salemme, also fo TDU, was elected president of a 3,000-member local.

In Pittsburgh, TDU leader Mel Packer was defeated in a bid for the presidency of Local 249, with 6,500 members, but his running mate, Rege Miller, was elected trustee of the local. In the presidential contest, the handpicked candidate of the union officialdom was also defeated, losing to a popular business agent who ran independently.

PROD and TDU have been active for several years in grass-roots challenges to the leadership of the International Brotherhood of Teamsters (IBT), with this year's total of 20 challenges in local races across the country setting a record. The two groups accuse the IBT of corruption and unresponsiveness to members' needs, while union leaders say the challengers represent only a small group of malcontents.