That's hardly the entirety of the decision. Aside from the pros/cons of renting vs buying, if that apartment is 30 minutes closer to work, you just saved 250 hours a year of your personal time. What's that worth?
Well, of course there are trade-offs for everything.
I personally cannot STAND sharing walls with people.
I have a pretty high end sound system, and I like to crank it up from time to time for music or maybe just watching the Flintstones at concert volume....without having to worry about people complaining.
And too...many of us enjoy having a bit of room in our own yards to stretch out..have a nice patio. I love to grill on my Big Green egg....or fire up my smoker and do BBQ (slow and low for up to about 18 hours or so).
I might want to fire up the big pot outside and have a crawfish boil with friends.
You can't keep a stack of smoking wood, that many cookers or even often use a grill with real fire on an apartment balcony.
I also like to have my own garage or carport for my car(s).
Sure there are trade-offs between living in the greater metropolitan/urban areas, you have to decide about your lifestyle and what suits it best.
Where I live, people engage in a LOT of the things I just mentioned, I won't even go into the number of people that have boats at their houses they take out quite often for fishing, skiing, etc. You can't do that stuff readily in an urban setting.
I have friends that like to be even more out, almost rural...that's not me, but I do like to stretch my arms out a bit in my own house and yard.