If you have the extra 1k to spare, i would go for the M4. Not only will you have the bit better performance, but don’t also forget the probably longer software support.
If you already had a M2 machine, I wouldn’t upgrade, but if you start with M machines i would just get the newest.