Interest in flats is overtaking demand for terraced homes with the return to office work, research suggests.