This comes down to real-world details. It'd be great if everything could be as efficient as the numbers above bear, but there's more to the process than just shipping. Shopping online results in 2.5 times more packaging than shopping in stores, so having many separate packages shipped can really add up. New Yorkers, for example, left more than 8,300 tons of cardboard and mixed paper to be recycled in the first full collection week after Christmas 2005, a 21 percent increase over the previous year. While all that can be recycled, it takes energy and infrastructure to do so.
Plus, every trip you make to the store isn't 20 miles round-trip, and every mile you don't drive to the store cuts back on the energy required to retrieve your stuff. If you live in a dense urban area, or have access to reliable public transportation, then a portion (or just about all, if you're walking) of your transportation energy is negated, and can tip the scale toward the brick 'n mortars.
A few other options to consider buying from retail stores include: Goods made locally; stuff that you are more likely to return (like clothes) if you can't try it on first; and, supporting stores who are owned and operated by locals, pay local taxes, and make where you live a more interesting and vibrant place. It's tough to put a price tag, environmentally or otherwise, on the social aspect, but it's important to consider.