IT IS hardly what the doctor ordered for a beleaguered, third-term mayor, up to his executive elbows in resignations, investigations and sagging morale up and down city hall, but Mayor Barry is losing his loyal, respected city administrator and No. 2 man, Thomas M. Downs. If Mr. Barry can take any small comfort in the departure of Mr. Downs for a top transit job in New York City, it is that this is not a desertion directly attributable to any of the problems of corruption or other personnel troubles that have complicated the retention and recruitment of competence in the top ranks of the local government. On the contrary, Mr. Downs served the city and its mayor long and well -- longer, in fact, than any other city administrator and with unquestioned integrity.

Though no one who has held this job could pretend to be totally apolitical in running the day-to-day operations or in serving as foil, point person, drill sergeant and stage manager for the mayor, Mr. Downs did his best to stay out of the limelight and to concentrate on issues of public administration. And with the memorable exception of a big snow-snarl earlier this year that left the downtown paralyzed and left him exasperated and uncharacteristically snippy, Mr. Downs endured his five years of long hours with gusto and good humor. "My job was to make sure I was dispensable," he commented the other day, "and the issues were important, and this has been the best all-around public I have served."

The loss of talent confronting Mr. Barry is significant: though some announcements may be forthcoming today, he is seeking a new staff director, a controller in his office, a director of finance and revenue, a secretary to the District and a deputy mayor for finance. Some promising and experienced administrators have been recruited lately, but the mission isn't easy, given the various troubles of the Barry administration. The mayor is reported to be preparing a staff shake-up aimed at improving the operation and reputation of his administration, but it may prove to be the greatest challenge he has had to meet so far.