The two big-box retailers’ fiscal second-quarter results had sharp differences, even as economic factors shape consumer spending.