> If two programmers were assigned a task [...] would [person with better math knowledge] be able to produce a better/faster solution?
It really depends on the task. If you work as a software engineer in a somewhat enterprisey setting, arguably many tasks don't even particularly require engineering or programming knowledge, let alone knowing any mathematics beyond high school level.
From working on a couple of decision-support-systems for larger enterprise clients, maybe the core 5-10% of some decision support systems needs some nontrivial understanding of operations research (e.g. linear programming, mixed integer programming techniques) / applied math (how to approximate functions & compute them efficiently) / basic comp sci algorithms concepts (e.g. graph theory to model networks for flows of traffic, goods, project dependencies, etc). The remaining 95-90% of the programming work is stuff like data validation, arranging things (data, code, libraries, build scripts) so they can be kept organised, writing tests, bolting on reporting systems, adding extra fields to things, figuring out how to cope with missing input data, etc. These kind of math-oriented decision support systems probably cannot be built with at least one person involved who is across some of the theory/practice of how the core of the system can be designed and built. So the difference between not having someone with a decent background in applied math/OR/graph theory on a project like this might be: the project just fails --- maybe something gets delivered and perhaps the client accepts it, but it probably doesn't really work.
But, that said: most of the programming work in the business world is essentially unrelated to maths/algorithms/OR stuff. Most line of business software projects have no clever core at all, e.g. web service exposing CRUD API for some kind of enterprise data. In these settings it is far more useful to be good at something like "project management" or "requirements analysis" or "designing the data model" than math, since the projects need essentially no math beyond perhaps the ability to do capacity planning or estimate if the design is going to under-perform massively.
If you specialise in some tricky kind of maths then depending on what you specialise in exactly there is some career risk that you will be very good at solving problems that hardly anyone has, so it may be hard to find work in that area, and if there are more specialists than work, the work may not pay that well when you find it. From a career perspective, if you are flexible about what you do for a living and what you learn, it's perhaps better to ask "what skills are likely to have demand outstripping supply in the future? which ones would it be feasible for me to learn? do some of them sound more interesting to me than others?".