Given just what you say, there is no difference, because a full analysis of each candidate will depend on many things as well as these.
But, a 3 and 4 year degree might start with different preconditions, leading to a shorter or longer time for completion. Too many variables. And there is even more reason for skepticism if the programs are in different countries. The education systems can vary widely between countries with some topics deemed essential taught earlier and others later in different countries. In particular, a program might require more than research as is true in the US (qualifying exams, for example).
And, the quality of the research is more important than the counts.
"All other factors the same" is pretty much impossible. We aren't machines. Institutional "fit" is even something considered by evaluators.
Trying to reduce faculty evaluation to an algorithm is probably a losing proposition. People contribute in different ways, some of them incapable of such comparison.
Twelve quality publications is pretty impressive, and may be unattainable early on in some fields.
However, beware of any program that puts a maximum time to completion with no options for extension. Research can take longer than anyone predicts at its start. Maximum time to completion is different from a fixed number of years of funding, however.