I am really torn on this one. I think in the end it would depend largely on whether you value batting higher than bowling or vice versa, since both have compelling cases.
Viv Richards was the best batsman of the 70s and 80s when bowling standards were super high. From 1976 to 1980 was perhaps the greatest peak of any batsman bar Bradman, when he averaged over 60 against high quality attacks across the world. Statistically, he was also quite consistent across countries and doesnt have any particular weakness. More than stats, he was simply destructive and no other batsman could put such fear in the bowler. Imagine Sehwag doing what he could do, but against better bowlers and on tougher wickets.
Malcolm Marshall has the best case to be considered the finest of all pacers. Statistically, he is nearly unmatched, he performed well everywhere. He had all the tools and lacked nothing, with a great ability to read batsmen. It should be mentioned that during his peak from 84-88, he averaged nearly 6 wickets per test despite so many other world class bowlers around him, a fantastic achievement. In recent years, there seems to be growing consensus that he was better than the rest. Virtually any World XI selected nowadays will feature him, while a good majority of those who faced him rank him as the best. His record comparatively speaking is slightly more impressive than Richards to be frank. The more you look into his records, the better it looks.
One difference between them is that Viv was arguably the greatest ODI player of all time, while Marshall didnt really succeed in that format. But I normally discount ODIs in my consideration.
You can make a case that Marshall has fewer contenders for top pacer spot than Richards for no.2 after Bradman, but I dont think that is a fair way to separate them since its not Richards fault that he has more opposition. Similarly, you can make the case that Richards was more important to the WI's dominating side than Marshall as Marshall could be more easily replaced, but again I dont feel that is a fair comparison of the quality each of them possessed. If WI happened to have been more batting heavy, would that have tipped it to Marshall?
Yeah, I call it a dead heat, maybe a slight edge to Richards for his ODI achievements and standing out as a batter in a bowling-friendly era. But on second thought I could give the edge to Marshall for basically a flawless resume. Hard to separate the two champs.