Assuming that this is the only difference and a similar range, I'd go for the 1x10. Simple reason: 1x10 are usually Deore (or Advent X), while 2x9 would be Acera/Alivio. There's a significant in reactivity between the two, and it's much nicer to use. My experience is that Acera/Alivio develop some play over time, and you need to change 2 gears then back to change gear, while Deore remains more consistent. They also require less "pressure" to operate, so that kind of mitigate one advantage of 2x: changing to the small chainring at traffic lights. But as mentioned in other comments, if there are other differences, they can make the difference.
That being said, if the current bike is in good order, except for the transmission, I'd go for a third option: replacing only the transmission with a Shimano Linkglide (new range targeting commuters and e-bikes, with a focus on durability). A new bike with a 1x10 or 2x9 won't be very different from the one you currently have (in terms of frame), and that would allow you to have components that are in higher ranges. The main point I would see where a newer would be better is about brakes: a new one would have disc brakes, while the old one has probably rim brakes. But there's a catch: good V-brakes with good pads are to my opinion better than entry-level mechanical disc brakes, and on-par with entry-level hydraulic disc brakes.
A note about: I am looking for a bike that would force me to do some effort. Taken literally, it's not the best approach. If you want to exercise, it's always best to choose the bike that requires the least effort: it's more enjoyable to use (so you'd use it more often), and if you want to make more effort, there's always the option to pedal harder or make detours. It's also not linked to the transmission, unless you take unsuited ratios (but then it would not be enjoyable).