I think either of the bikes you mentioned would be fine. Honestly for hardtails at a particular price point all bikes are going to be very similar once you exclude the mail order brands.
Not to harp on what others have said, but to give you an idea of second hand about 2k USD is what I paid for my current bike. It’s a carbon Norco Revolver full suspension, built up with a full XTR groupset and other high end parts.
Unless you go hard tail or used - which will still be cutting it close. I’d sell my Felt Nine 1 with eagle, SID WC, specialized carbon dropper, for 2K if not more. Just to give you an idea what you’re looking at.
Pinkbike, eBay are your best bets. Have bought several bikes online like this. Used for a year or two and sold for close to what I paid for.
Pretty much what everyone else has said, Hardtail is going to be your only option if you are buying new at that price point. Honestly, I’d save about $1500 more and get something you really want and be able to keep for a few years. Direct to consumer online brands are going to be cheaper as well, if you’re not committed to your local bike shop. On a sidenote, I’ve been very happy with the used bikes I have bought in the past. They are usually about 30-40% off retail.
I’m not opposed to used, just haven’t seen much locally.
I do like having the local shop behind me on a bike; my local Specialized dealer has come through with HUGE warranty claims for me before, so I’d like to buy local unless i find a great deal on something used.