The Baltimore-based securities and investment banking firm Legg Mason Inc. said its earnings fell for the fiscal year ended March 31 despite an increase in revenue because of rising costs and losses pertaining to the Baldwin-United bankruptcy.

Meanwhile, Washington Real Estate Investment Trust reported an increase in first-quarter income, while Essex Corp., an Alexandria engineering and professional services firm, said it lost money in the first quarter.

Legg Mason said its revenue for the fiscal year totaled $72.8 million, up 12 percent from the year-earlier level of $65.1 million. But earnings for the year dropped 41 percent, to $3 million (70 cents a share) from $5.1 million ($1.30), according to the company.

Legg Mason attributed the decline in earnings to rising salary, communications, computer and real estate costs -- incurred in part as a result of expansion and improvement -- and to the effects of a $1.2 million reserve set up by the company to cover losses relating to the Baldwin-United fiasco. That reserve reduced after-tax earnings by $500,000, the company said.

In the final quarter of the fiscal year, Legg Mason said, it earned $1.5 million (34 cents), up 21 percent from $1.2 million (28 cents) a year ago. Revenue rose 41 percent to $23 million from $16.3 million in the final three months.

* Essex Corp. said it had expected "somewhat sluggish" first-half results this year; so far, the prediction has proven correct, as start-up costs in its office systems and personnel placement businesses cut into earnings. The company said it lost $14,270 in the first quarter, compared with a profit of $152,135 (12 cents) a year ago. Revenue in the quarter also was off, to $5.1 million, a 6 percent decline from first-quarter 1984 revenue of $5.5 million.

* Bethesda-based Washington Real Estate Investment Trust, which owns a variety of commercial and residential properties in the Washington area, said it earned $2.2 million (41 cents) in the first quarter of 1985, up 8 percent from $2.1 million (38 cents) a year ago. It said its total assets at the end of the quarter were $77.8 million, compared with $75.9 million a year ago.