Alibaba Group Holding Ltd. posted profit that beat analysts’ estimates in its first earnings report as a public company, with increased shopping traffic and mobile spending in China generating more advertising.