the 2017 car will have a 30kwh battery with 8 year warranty, the 2015 will have a 24kwh battery with 5 year warranty. 2017 will be a better bet no matter what, because you will get a new battery for 5 more years from now if it degrades enough, whereas the 2015 car will have its warranty expire this year.
to answer your question, miles seem to matter less than time. more miles over less miles in the same amount of time will wear the battery out more, but ultimately time (and more specifically temperature/usage/storage patterns) wears it out most.
2013 Leaf SL Premium
27k, 93% SoH 2/17 32k, 96% SoH 6/17
46k, 94% SoH 2/18 52k, 88% SoH 6/18
62k, 87% SoH 2/19 68k, 84% SoH 6/19
75k, 83% SoH 2/20