The Brazilian delivery company spent years building a national network. Its next opportunity was waiting behind the counters of neighborhood shops.