The difference in RAM only is important if the active programs (the game you run or all general use programs together) use more than 32 GB. Then the swapping that is necessary might slow down the machine with less RAM, even if it has a faster CPU. Or not, of course, depending on the exact use. To compare the speed of 2 different x'es (be it CPU, GPU, RAM, motherboard, disk) keep ALL other components (including the benchmark tool) the same.
So the question boils down to 'what CPU is faster'. If you look at the CPU-tests at tomshardware.com, you see that that might depend on the task. It's quite imaginable one is faster for video processing, the other faster for a multi-core chess playing program or a doing SQL queries on a 10 GB in-core database.
So better start benchmarking!