A federal judge has indicated that he is leaning toward ordering the Department of Defense to release the home towns and states of residence of 34 former World War II servicemen who may have fathered illegitimate children in Britain.

A ruling issued yesterday by U.S. District Judge Thomas Penfield Jackson gave the Pentagon 60 days to come up with affidavits from the 34 ex-servicemen stating that they do not want their identities made public. Failing that, he said, he would order the information released.

The ruling comes in a 1988 lawsuit filed here on behalf of a British organization known as War Babes. The group, which has about 300 members, represents British citizens who were the offspring of wartime liaisons between British women and American GIs.

Members of the group, searching for their natural fathers, have tried for years to get information from the National Archives and Records Administration, custodian of Army records dating back to World War II.

But the group's Freedom of Information Act requests have been turned down by the Defense Department and the archives on grounds that releasing information would be an unwarranted invasion of the former servicemen's privacy.

Calling the legal dispute one of "unusual poignancy," Jackson said the privacy assertions were "sheer speculation" because neither agency had asked the servicemen whether they minded having their hometowns made public.

Joan Meier, a Washington attorney who represents War Babes in the lawsuit, said yesterday that she was pleased with the decision. "It sounds like what we've been saying all along: that the government has no evidence that this would be an invasion of privacy," she said.