Consolidated Groupby nth / last object Templates
- [X] closes #19569
- [ ] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Updated to prevent the group_rank_object method from being templated after the merging of #19481 