Two Richmond investors have agred to purchase Virginia Real Estate Investment Trust for $22.6 million, the trust's president, Charles B. Davis III, announced yesterday.

Virginia REIT's trustee signed an agreement in principle to sell the business to James B. Farinholt Jr. and A. Hugh Ewing III, owners of Gallher & Co., a Richmond investment firm.

Ewing and Farinholt offered to pay $21.50 a share for the real estate trust. The trust's properties were valued at about $20 a share by a firm hired last year to study potential sale or merger of the firm. Virginia REIT owns four shopping centers -- the largest is the Barracks Road Center in Richmond -- four apartment buildings and a Holiday Inn.

Members of the board of trustees own about 26 percent of the REIT's stock and have agreed to sell their shares, a spokesman said yesterday. A majority of the REIT's shareholders must approve the buy-out.

Farinholt the Ewing plan to form a corporation to aquire the REIT's stock. Davis, president of the trust for several years, will be a partner in the new venture and will continue to manage the properties.

The timetable calls for the buy-out to be completed as soon as possible.

The buyers are to obtain financing by Sept. 1, to complete a formal acquisition study by Oct. 1 and to make an offer to shareholders after that.