sudo: setrlimit(8): Invalid argument

Have you checked your PATH?

I just installed sudo-1.8.31.mac1015.pkg and found out that the package installs sudo to /usr/local instead of the default /usr.

If you are not sure, run which -a sudo, the one at the top will be used. To override, just add

PATH="/usr/local/bin:$PATH"

to your ~/.zshrc