Should I replace 2017 15 inch i7 16GB RAM, with 13 inch 2020 i5 16GB RAM?
Moving down to a 13" form factor after using a 15" can be quite an adjustment. I'd think long and hard about that.
Secondly, there's advantages and disadvantages with choosing another intel based Mac. I would recommend going that route if you have some must have apps that need intel but in reality if there's no such constraint I'd go for a newer laptop.
Questions to ask yourself as you decide on your next steps.
1. Does the 2017 fail to perform, do programs no longer work or are too slow?
2. Is the battery the cause of concert - if so, would a battery replacement be a stop gap measure to stave off spending so much money?
3. What does a 13" 2020 model give you that the 15" doesn't?