Both have a TDP of 25 watts meaning that if both are pushed to their maximum the processor frequency has the potential of dropping to
i5-7200U
Processor Base Frequency = 2.50 GHz
https://ark.intel.com/products/95443/Intel-Core-i5-7200U-Processor-3M-Cache-up-to-3_10-GHz
i5-8250U
Processor Base Frequency = 1.60 GHz
https://ark.intel.com/products/124967/Intel-Core-i5-8250U-Processor-6M-Cache-up-to-3_40-GHz
Intel can't pull speed out of a hat and so to fit in those extra cores/threads into the i5-8250U they had to drastically low the processor base frequency.
The worst case scenario would be if you used both processors at 100% usage giving us the scenario
8 threads at 1.60GHz versus 4 threads at 2.50 GHz
Doing some quick napkin math,
8 threads x 1.6Ghz = 12.8 hypothetical GHz
4 threads x 2.5Ghz = 10 hypothetical Ghz
If the load only sufficiently uses 4 threads at 100% the decision becomes a toss up.
For example lets say the i5-8250U only had to use 4 of its cores for the workload and with that combination it was able to hit 75% of its maximum frequency versus the i5-7200u running full blast as in the last example,
(8 threads x 0.5) x (3.4 x 0.75) = 10.2 hypothetical GHz
4 threads x 2.5 = 10.0 hypothetical GHz
In both cases the i5-8250U has between a 2% and a 28% lead over the i5-7200U making the i5-8250U the clear winner.