I now think that I had misunderstood the situation. I'm not sure why it works on our test server, but our production Redmine instance reverted to its broken state this morning. It probably worked directly after the upgrade because I had not restarted apache2.
Looking at the package versions, I now think that the fixed packages had not yet made their way into the repository, so when I ran "apt-get upgrade", I was reinstalling the broken packages.
I've now installed the packages from
https://people.debian.org/~utkarsh/lts/rails/ on the test server and restarted apache2, and it's working. However, it was working there before the upgrade, so I'm not sure of the reason for the difference between the test and production servers.
For the production server, I've just applied the same fix as before - temporarily downgrading the packages. I'll upgrade again when the fixed packages make their way into the repository.