Wal-Mart Stores, the world’s largest retailer, finished the biggest quarter of its fiscal year with a mixed picture.