Assuming that the recommended cassettes/chainrings are proposed, ranges will be equivalent.
- 36/26 chainrings, 11/42 cassette for the 2x10: 523%
- 10/51 for the 1x12: 510% (for 1x, the range of doesn't depend on the chainrings). Note that sometimes, 11/51 are offered with the M6100, so in that case the range advantage goes to the 2x.
There are also a lot of "redundant speeds" on a 2x10 setup, the number of actual different ratio is closer to 14 than 20.
But the range is just a ratio between the highest and lowest combination. It doesn't give any absolute indication.
So the answer will depend on the chainring: if the 1x12 has a 32T chainring, the range will be meant for lower speeds/steeper climbs. If the chainring has a 36T chainring, the two bikes will be really equivalents — replacing the chainring is usually simple, that being said.
Personally, just based on this difference, I would go for the 1x12. Simpler to operate, and also uses a slightly higher product range than the 2x10 and it's a more up to date design. The 1x12 also has a very small advantage if you want to fit larger tires.
Finding spares or upgrades will be easier: the 1x12 has just been upgraded on the whole Shimano mid- and upper- range (Deore M6100/SLX/XT), and you can mix components: you can have a XT shifter, SLX cassette and Deore derailleur. The 2x10 is a mid-range product, and the availability/offer of spares is already declining. From my research, finding spare cassettes for the M4120 is currently very complicated (hint: 2 of the 4 bikes at home use a 11/42 10-sp cassette), availability in Europe for this cassette is close to zero. What will happen in the future is only speculation, but seeing how the bike industry has reacted to the shortages, it was clear that the priority has been given to higher range products. So buying this specific configuration now is a bit of a bet:
- supply issues are solved, and in that case finding cassette won't be complicated. But the offer will probably limited to the steel ones — not an issue per se.
- supply issues are not solved, and in that case, you'll have the choice of running your bike with out of spec components or replace more just than the cassette because of a lack of spares (there's some nuance to that, but it's better to address it in a separate question).
[EDIT] I remembered that the RD-M4120 is actually a 10 AND 11 speed rear derailleur. Given 11/42 11-speed cassettes are still widespread (still the default for Shimano 1x gravel drivetrains and SRAM Apex). The argument of not finding spares is actually not valid for this rear derailleur. To use a 11 speed cassette, only the shifter (and the chain) needs be replaced, the rest can be kept as it is.