No, it will not unroot your phone after factory reset. But you will need to reinstall supersu app.

Will a hard reset Unroot my phone?

No, it will not unroot your phone after factory reset. But you will need to reinstall supersu app.

What happens if I factory reset rooted phone?

A factory data reset erases your data from the phone. While data stored in your Google Account can be restored, all apps and their data will be uninstalled. To be ready to restore your data, make sure that it’s in your Google Account. Find out how to back up your data.

How can I Unroot my phone without losing data?

Once your phone is rooted, you can always turn off root access with the installed superuser-app, and turn it on again if you need it, and that won’t lose you any data.