The six-story apartment building on Route 9 in Brookline will include four ground-level retail spaces and 50 apartments, nine of which come with affordability restrictions.