Thomas Bradley, president of the Maryland-D.C. AFL-CIO, knew he was taking a calculated risk.

In a darkened corner of Riordan's restaurant last month, the union head, nibbling at a plate of crab cakes, refused outright a reporter's request to estimate how many demonstrators would show up for his Solidarity Day rally on the State House lawn. If it rained the day of the rally, Bradley said, he might be the only one to show up.

But last Saturday, 4,000 demonstrators, by police estimates--and more than twice that number by Bradley's count--showed up in the drizzling rain to let Maryland legislators know that Reaganomics may be playing in Peoria but it won't play here.

Small wonder then that a beaming Bradley boasted to the same reporter at the gathering: "This is the biggest rally ever in Annapolis--period!"

For Bradley, the risk was whether Maryland's divided workers would bury their traditional factionalism and come together in a symbolic show of unity to protest President Reagan's economic policies. But the larger bet is whether high unemployment and recession have hit this state so hard that Maryland's workers for the first time can be galvanized into an effective statewide political coalition.

"That's partly what Solidarity Day is all about," Bradley said, laying down the stakes in his own blunt manner: "to make our coalition more viable looking to primary elections in September."

From the size of Saturday's turnout, Bradley seems to have won his initial bet. Workers came from every corner of the state: blue-collar steelworkers, white-collar federal employes, teachers and autoworkers, blacks and whites, all reeling from unprecedented (by Maryland standards) 9.7 percent unemployment.

For one rainy day, as one labor leader at the rally put it, Ronald Reagan with his economic policies managed to do what successive union leaders in Maryland have failed to do: close the gap between union leaders and their rank-and-file, bury the racial schisms and bring white- and blue-collar workers together.

But the larger bet--whether that coalition can stay together on election day--may not be settled until this fall's primary election campaigns, and possibly even much later. The potential, given organized labor's half million members statewide, is staggering.

"They (the numbers of union members) are monstrous," said Edmond F. Rovner, a former labor lawyer now working as an assistant to the Montgomery County executive. "They are potentially so big. . . . They have never really been able to put their muscle together."

Of all the divisions that have weakened labor in this state, perhaps the deepest split has been that between blue-collar workers, concentrated in Baltimore and the surrounding county, and the high number of white-collar government workers, particularly in the Washington suburbs. The two groups have had little in common until now, when both are reeling from the same high unemployment rate.

A government job used to be considered "safe" employment, but now with Reductions in Force (RIFs), those middle-class professional workers are finding a new kinship with their hard-hat union brothers in the steel mills and on the auto lines.

"The federal employes in suburban Washington have lost jobs," said Josh Williams, president of the Metropolitan Washington Council of the AFL-CIO. "You can't pit public employes against private sector employes anymore because they're both getting screwed."

"The effect is the same on the federal worker as it is on the blue-collar worker," said Del. Robert Redding (D-Prince George's), a former electrical workers union member. "For the first time since World War II, the federal worker is now concerned about jobs. It could have an enormous impact on elections in the next few years."

"It's going to get worse," Bradley said. "The Reagan administration is going to eliminate the Department of Energy and the Department of Education. . . . It's middle class people now who are hurting."

Another major division that has stymied labor's potential power in the past has been the historic racial barrier between blacks and white workers.

"The wedge that's been driven between them has served the interest of the political clubs," Rovner said. Blacks and blue-collar workers together have the numbers to control Baltimore city politics, he added. But racism has kept these natural allies at loggerheads.

Some believe that the current advertisements by the National Political Action Committee aimed at liberal Democratic Sen. Paul Sarbanes--ads blasting Sarbanes for supporting "forced busing"--are playing to racism among Baltimore's ethnic, blue-collar working class, the same constituency Reagan successfully played to nationwide in 1980.

But blacks and whites shared the stage at the Solidarity Day rally, and one delegate, Redding, remarked with some amazement at how every group was mixed as they clasped hands beneath multicolored banners proclaiming "Don't Reaganize Maryland." As part of his strategy, Bradley got the state's NAACP to cosponsor "Solidarity Day," and black ministers and politicians were prominent.

"This is the old Democratic coalition coming back together," said Del. Larry Young (D-Baltimore), a black delegate on stage.

Added Del. Redding, "People have to now be cognizant of what a force this may well be in November."