Three District men convicted of robbing the Georgetown branch of National Savings and Trust Co. last November were each sentenced by a federal judge yesterday to serve up to 18 years in prison.

The defendants, 27-year-old twins Stanley and Bradley Holmes, of 4404 Quarles St. NE, and Lewis Blakeney, 21, of 1815 Q St. SE, were suspected members of an organization that recruited youths from public housing projects to rob banks, law enforcement officials said.

Before imposing the sentences, U.S. District Judge Gerhard A. Gesell noted that masks and loaded guns were used during the holdup, which he called a "highly professional bank robbery."

The government's key witness in the case refused to testify during a trial for three men, saying he was upset that they had been released on bond after their arrest and that he feared for the safety of his family. Gesell held the witness in contempt of court and fined him $100.

Gesell also sentenced another convicted bank robber, Michael T. Marshall, 18, of 1616 E St. SE, yesterday to 10 years in jail for an armed holdup last November of the Jefferson Federal Savings and Loan at 1911 Michigan Ave. NE. At the time, Marshall had just been paroled from a Virginia prison where he was serving a term of a 1978 bank holdup in Arlington, according to law enforcement officials.

Gesell ordered a codefendant in that case, Eugene H. Porter, 18, to undergo tests at a federal correction center to determine if he would be a likely candidate for rehabilitation and benefit from sentencing under the terms of the federal Youth Corrections Act.