Aliases are only active in your interactive shell.
True, but then you have the occasional headscratcher that the command behaves differently in your script than when you run it manually.
Exactly, if grep behaves differently in your scripts and your shell, there's no point in not using ripgrep (or ag, or silver searcher, or whatever strikes your fancy).
The difference is - your script works out of the box, or you need to install ripgrep.