That said, it really boils down to the engine.
I certainly believe that once one gets past the usual stumbling blocks to speed on the bike side of things (fit, geometry, good stiffness, decent parts, decent wheels), the difference is slight and rider dependent.
This^.
Hypothetical, 'fan boy' musings aside, there are a few folding bike races in the world. The 'winning bike' is often sponsored by a company that hired a professional racer to power it. Well, duh. That said, one would probably want a light, stiff folding bike set up for aerodynamics and efficient transfer of power, something like
this actual folding bike race winner.