What is the life expectancy of a Magic Mouse 2 battery?
The Magic Mouse 2 uses a lithium ion battery and generally speaking those have a useful life of 3 to 5 years1.
That said, it's important to note that:

Apple products (including accessories) have a 1 year warranty
Only accessories included with a Mac computer are covered under AppleCare.  In other words, if you buy AppleCare for your iMac that includes the Magic Mouse, it's covered.  It won't cover it if you bought the mouse separately (like with a MacBook)

From personal experience, I've had rechargeable batteries in a Logitech Mouse last the better part of a decade and brand new batteries (genuine OEM) from Dell and Apple fail after a year. YMMV. (your mileage may vary)


1Manufacturers' information typically specify lifespan in terms of the number of cycles (e.g., capacity dropping linearly to 80% over 500 cycles), with no mention of chronological age.[162] On average, lifetimes consist of 1000 cycles,[163] although battery performance is rarely specified for more than 500 cycles. This means that batteries of mobile phones, or other hand-held devices in daily use, are not expected to last longer than three years. Some batteries based on carbon anodes offer more than 10,000 cycles.[164]