This is one of those cases where I'd say it's more a case of choosing the "least bad" option rather than the "good" option. Whichever way you go, there will be some users and/or some situations where it might be better if you had done the opposite. However, think of the case where someone is switching tabs relatively quickly - let's say referring to something on 1 tab because it's relevant to what they're doing on another tab. To reset positions as you change tabs would be very annoying - and I think this overrides the convenience of resetting tabs for when that would actually be more appropriate.
If you are building a native app, then the default behaviour on iOS would be to save where the user was. So iOS users will be comfortable with that approach.
On Android there really is no standard (at least for native apps) as the tabs at the bottom has really been discouraged on Android as basically a "lazy" adaptation of iOS. Generally the hamburger menu and/or tabs at the top of the screen are used instead. Google recently blessed the row of tabs at the bottom but I think it will stay relatively discouraged due to the potential to accidentally tap the OS soft-keys (like back).
In addition, be aware that things like phone calls or switching to a different app perhaps in response to a push notification etc. would be likely to trigger the same code flow - i.e. reset tabs.
Note on both iOS and Android the OS can kill apps pretty much whenever the OS wants to manage resources on the device. So, even though users may want their tab to be preserved, they will generally realise that sometimes things are reset - and it's more likely the longer the time is between app visits and the more other things you do on your device in between.
PS - if you want to continue researching this, the correct terminology might help in searches. It's called a "tab bar" on iOS, and an "action bar" on Android.