You're assuming the working conditions in one are substantially better than the other. But even if that's the case and stores have to offer higher pay to staff their warehouses, the higher pay will attract job seekers of all genders. And anyway, we're talking about a largely unskilled workforce working for an hourly wage, not salaried employees.
There's no reason a woman can't pick goods off a warehouse shelf or a man can't place those same goods on a shelf in a grocery store.
We aren't assuming, we know the working conditions are better for the cashiers. More comfortable environment, far less lifting.
You are assuming that people will apply for the distribution center jobs in equal numbers. Hint: In the distribution center you're handling product in cases. The person placing goods on the shelf spends most of their time placing individual items, not cases. Reality: On average, men are stronger than women. Thus you would expect to see more men in the distribution center, more women as cashiers. It's a simple example of comparative advantage at work.