I’d start by matching your local environment with that of Github Pages. That usually flushes out weird issues like yours. Best way to do so is by using the Github Pages gem (link below).
Looking at your Gemfile, Jekyll is set to 4.0.0, which Github Pages does not yet support. You’re running 4.0.0 locally and 3.8.5 on Github Pages (the latest version currently supported by Github Pages).
Ok, so because there is no way to stop Github Pagesfrom using MathJax because this line in the github pages gem, which is used by Github Pages and probably won’t be changed because there is an open pull request to change this since June 2019.
So thanks, I’ll try to find a workaround.