head to head
Neither is simply harder - they are hard in different places. Portal 2 demands more optimization; The Medium demands more variance.

Optimization · Pure Optimization
A first-person puzzle game where seeing the solution is the whole skill.

Optimization · Pure Optimization
A fixed-camera horror puzzle game solved by methodical dual-world navigation and item sequencing.
Portal 2 leans Optimization (Pure Optimization); The Medium leans Optimization (Pure Optimization).
Portal 2 leans a little harder on execution, though the gap is small.
Portal 2
Portal placement requires some precision but timing is lenient.
The Medium
Third-person movement and simple stealth; very low twitch demand
Same score on reads - which means the number cannot separate them. The difference is in what each one asks of you.
Portal 2
No opponent; puzzles are static.
The Medium
No adaptive opponents; Maw is a scripted threat
The Medium leans clearly harder on variance.
Portal 2
Puzzles are deterministic with no randomness.
The Medium
Some item locations hidden on first run
Portal 2 leans clearly harder on optimization.
Portal 2
Solving the puzzle's logic IS the entire game.
The Medium
Dual-world puzzle solutions are deterministic and fully learnable
A matching score does not mean a matching test. Two games can both sit at 10 on execution and demand completely different things of you - which is why the reasoning above matters more than the number beside it.