The '22 seems a bit high, It's not hard to find them in the upper 40s around me, but then again you didnt list mileage or anything else about the vehicle.
https://www.cargurus.com/Cars/invent...NWIDE_SHIPPING
Seeing as they are still making the babyMs, and the 25 is a new style, you can look up what the 2019s are going for to get an idea of resale on the 22.
The M is the mystery on value (if anything) bec there are no plans for 25/26 MY, the earliest I have heard is MAYBE a 27/28 and no details on if thatll be gas/ele/hybrid (think XM)
you know you are going to lose $36k on the lease for sure, I doubt the 22 will depreciate THAT much . 2018 m40s are still going for 20ish - so if you could get one for under 50, and you don't have nay repairs in 3 years, that would financially be the safer bet, BUT it is a BMW, so maintenance costs + possible repairs, I'd say either will end up costing you 30-35k /3yrs ...
no financial advice, just spitballing quick numbers