Citigroup reported second-quarter earnings that topped forecasts even as revenue fell short of estimates.