Yes, the approach you provided is available in the SharePoint.
Due to by default, organization level settings define the version history limits that are applied to all new document libraries created in a site.
So, the first you mentioned is not necessary. First, use PowerShell to define versioning settings and apply the trim script in each site separately. Then set version history limit from the tenant level.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.