I don't think I'd say the cost of living is higher in Boston's suburbs than it is in the city. Of course there are exceptions to the rule, but as a whole, It's cheaper to live in the Boston area suburbs and many people do so because their dollar goes further. For instance, 600k will buy a 3 bedroom condo in S. Boston (that's even a stretch) while it will buy a 4 bedroom house in Stoughton and they can commute into the city.
I would also argue that Portland is probably fairly comparable in terms of cost of living with the suburbs in the area. In fact, the average household income in In Metro Portland is on par with the national average (about $42,000) ranging from about $35,000(Portland) - $56,000(Scarborough) (Westbrook is at $37,000 btw). That (like most cities), while not much of a variation, would show that higher incomes tend to live outside the city of Portland. Also, rents and mortgage costs are higher in the immediate suburbs of Portland than in the city itself.
In Boston, while there's an even larger gap in average household incomes ($39,000 in Boston- over $110,000 in many suburban towns topping out at $154,000 in Weston), rents and mortgages are higher in Boston proper (and again, you get a lot more for the money outside the city) than they are in the suburbs. Essentially, the numbers show that the reverse of what you stated appears to be true.
Both cities' metropolitan areas ARE growing (as are most cities in the US, like you said), but I don't think you can attribute Portland Proper's population loss to the cost of living in the area. I think it can be attributed to the sprawl in the area and ease of commute to the city. People can live in a larger home, more secluded area and commute easily into Portland to work. The city itself hasn't yet found a way to attract more residents in to replace the people moving to the suburbs.
I am surprised that more people don't move into Portland City Limits, just outside Downtown. Much, if not most of Portland is suburban and quiet. This is especially true off of the peninsula, and I would figure it would be an attractive area for suburbanites and the population would increase as a result.
This is not to say that you are wrong, Patrick; I just believe that your reasoning for the decrease in Portland's population as opposed to the increase in Boston's isn't 100% on the mark. I think Portland's metro area is growing and will continue to grow. In fact, I think it's one of a small handful of New England cities that is in great shape in terms of growth and development at the moment.
*edit* All stats on household income, rent, mortgage costs, etc were found on
www.epodunk.com but searching the individual cities mentioned.