An investor has acquired a nearly 18,000-square-foot mixed-use building in downtown Somerville for $4.2 million, in a newly announced deal by Marcus & Millichap.