I suppose each dealership is different but years ago when I worked for Lexus, we warrantied a lot of batteries, no matter the age of the car. Now it’s been a minute since I last worked in a parts department, but there should be a free replacement period of some sort. Maybe it’s not 2 years, it could be less. If the replacement battery has a problem two years from now, I would certainly start there. I would tell anyone, though, the more better your service history, the more willing a dealership will be to work with you on warranty issues.