What career option is the most viable if one has very wide research interests? I'm in mathematics, and have recently gotten an opportunity to do applied/industrial research for a strong research institute in my country. As of now I have two MSc degrees in math and engineering respectively, and I also legally qualify as an Engineer. I have a passion for math, but also physics, computer science, and engineering. Thus I have very wide interests and want to continue to do research and interconnect these topics.

I fear that if I choose to go into research (my country's rough equivalent to the latter part of a PhD) I will not have the opportunity to conduct research in different topics, but rather have to specialize myself in a subarea of a math field.

At a research institute I will not be able to do pure math, but I'll have a very good pay and I'll at least get to do some applied/industrial math and publish in those areas. I will also be able to get a doctorate (latter part of PhD) via the research institute, but again it will be in applied math.

Right now I'm thinking of trying it out, and switch back if I don't like it as much, relying on my publications and teaching experience to get in somewhere.

Going fully into academia doesn't seem a good idea if I want to have varying research areas, but at least I'll get to choose my specialization. Going into industrial research I will have a varying job, good pay, but not as much intellectual stimulus and I can't choose my projects. How can one approach this, and what can I do to make either of these a better choice?
My best advice, though it might not suit everyone, is to pick something, anything, that you are willing to work very hard at for a decade or so and become an expert in that field as an academic (my choice). At that point you can probably get tenure and with tenure you can set your own research agenda, more or less. But your ideal academic job may or may not be in your current country of choice. 

In some academic jobs you can set the research agenda completely yourself, though you may need to convince people that you are contributing to the mission of the institution. But if you are a mathematician who made the grade in, say, topology, no-one will be likely to tell you that you need to keep doing topology, and few will tell you that you can't branch out into applied fields, or even quite different fields for at least part of the time. 

And, in fact, many academics do change their interests over time, even if they stay fairly close to the core field they started in. 

But an industrial job, now-a-days, comes with many restrictions on what you can do and many requirements on what you must do. The days of old in, for example, Sun Microsystems or Bell Labs, are over. People in the successors of those places generally can't just think deep thoughts and try to build something interesting. But even in those old style labs, the people permitted to do that were few and had already risen through hard work in the lesser jobs for some decades that left them at the top of the heap. There are surely exceptions, but I think very rare. 

But the bottom line, is that if you want to be a polymath, then you need to work very hard to build a reputation that lets you have the freedom to do what you want. It is just more accessible in academia, I think.