For Charles L. Scharfe Jr., the fall from power at the electrical construction firm of E.C. Ernst came as swiftly as his rapid rise to the top management job.

Or did it?

That intriguing question was unanswered last night after a series of corporate and legal maneuvers that deepened a mystery surrounding the Washington company's operations in the past six months.

For its part, Ernst announced early yesterday that Scharfe, who became chief executive on Aug. 20, had stepped down from that post as well as that of board chairman and from the board's executive committee.

No so, said lawyers for Scharfe, who went to court in New York in the afternoon and filed a suit against Ernst alleging misrepresentation of the firm's accounts and asking the court to rescind a June 1 merger of L.K. Comstock & Co. into Ernst.

In addition, Scharfe said he has not resigned as chairman of Ernst. He has not yet decided whether to do so, Scharfe's lawyers said.

The lawsuit, filed on behalf of Scharfe and 61 other former stockholders of Comstock, now an Ernst subsidiary, said the Washington firm forecast profits of $4 million in the year ended last March 31. In fact, Ernst posted a surprise loss of $5.8 million.

Company officers declined comment on the developments, which also involved an announcement that two other board members had resigned from the audit committee.

Moreover, Ernst said the auditing firm of Arthur Young & Co. has been asked to examine Ernst's balance sheet as of Sept. 30 in an "enlarged engagement."

Young already was investigating Ernst accounting for possible irregularities in reporting contract income for the fiscal year ended last March 31 - a period before Scharfe took over last summer.

Scharfe had been chief executive of L.K. Comstock & Co., a Danbury Conn., electrical contractor that merged with Ernst on June 1. Scharfe subsequently replaced Edward Johnson at Ernst - first as chief executive and then as chairman.

A lawsuit was filed last week by a Ernst stockholder alleging that company accounting was fraudulent during fiscal 1978.

Named as acting chief executive of Ernst yesterday was Joseph E. Griffin, who rejoined management on Oct. 18 as senior vice president for finance.

Griffin, who had been a director and chief financial officer prior to 1973, was in New York yesterday and unavilable for comment. There was speculation that Griffin was participating in talks with lending banks on continuing and expanding Ernst's lines of credit.

Because other Ernst officials named in the stockholders' lawsuit, it was necessary to place in top management an individual not connected with the recent events, one source stated, explaining a possible reason for Scharfe's resignation.

Griffin, former vice president for financial of General Waterworks Co. in Philadelphia, first joined the Ernst board in 1969 and is familiar with company operations and financial problems.

The board members who resigned from the audit committee yesterday were David Eggers, consultant to an architectural business he formerly headed, and Walter V. Knopp, an engineer and consultant. Both were named to the Ernst board in recent months.

Scharfe, Eggers and Knopp will remain as directors, according to the company announcement. But Scharfe's action later in the day raised questions about what really happened. Scharfe and his father owned about 80 percent of Comstock's shares before the merger with Ernst.

The legal action named current and former Ernst officers, former auditor Richard A. Eisner & Co. and the law firm of Tanner & Gilbert as defendants, and seeks damages for the former Comstock owners.

Ernst said yesterday the expanded accounting examination will include the books of Ernst and Comstock, now a subsidiary. Richard A. Eisner & Co. was dismissed as the Ernst accountants after the last fiscal year ended - a year during which Eisner has a dispute with management over the value of certain contracts. Ernst then rehired Young - which had itself been fired in March 1977.

Because of contract re-evaluations, Ernst posted a surprise $5.8 million loss on sales of 129 million in the recent fiscal year and stopped paying dividends.