Difficult to compare.
By nomenclature, they both are allrounders, but its like comparing a bowler with a batsman, since their primary skills were different.
Since bowlers are the one who mostly control test matches, they are the ones who possess greater match-winning abilities. But that shouldn't necessarily or by default make them a better player.
One thing I have noticed that people raise doubts over Sobers bowling ability because of his bowling SR, but don't take into consideration the time in which he played.
Those were the days, when batsmen don't used to attack spinners like today and spinners do rely on batsman making mistakes for their wickets. Hence bowling strike rates of spinners used to be much higher as compared to today, particularly the finger spinners.
Just see what used to be the strike rate of common spinner during Sober's period.
And that consists of mostly full time spinners. I am sure, if we further dissect it into finger and wrist spinners, it will increase even further for finger spinners.
Even if we look spinners of that era individually, their strike rates were
Gibbs : 88
Nadkarni : 104
Venkat : 95
Valentine : 93
Ramadhin : 88
Illingworth : 98
Bedi : 80
Only Underwood, Prassana and Lock have less than 80 strike rate during that time. (Sobers bowling SR too was less than 80 during 8 year period in 60s).
So Sobers by any means was barely lesser than a typical full time finger spinner of his era.
Sobers fulfills the definition of word 'allrounder' better than anyone else. Was a brilliant fielder and could bowl 3 different varieties with the ball and was captain in 30+ matches. He was most natural cricketer ever, could do anything on cricket field, a cricket is expected to do. As mentioned earlier, Sobers used to perform both with the bat and ball simultaneously while Imran, apart from that 82 series, mostly gave performance in either of the departments.
Excluding Imran's captaincy, purely as a cricketer, Sobers is better for me, not by much, but he is better!