Vous avez probablement juste besoin de modifier un peu la première requête :
return Post::selectRaw('Count(likes.id) + Count(comments.id) as total_count')
->withCount(['likes', 'comments'])
->groupBy('posts.id')
->orderByRaw('(Count(likes.id) + Count(comments.id)) desc')
->paginate();