Referring to previous words
The first sentence is fine.
The purpose of a language is to communicate, not to construct something that's logically rigorous. This means that occasionally, there are grammatical sentences that are ambiguous in meaning (eg He bowled a maiden over). However, your first sentence isn't really ambiguous - common sense prevails, and "their" can only reasonably be understood to refer to the mathematicians.
Pronominal coreference is not as simple as you make it sound. A pronoun does not in fact have to refer to "the last thing mentioned".
An English pronoun can be coreferential with any noun phrase at all, preceding or not, in the same sentence or not, providing certain conditions are met. The most important condition is that a pronoun may not both precede and command its antecedent.
It can neither precede nor command its antecedent
- The old man stood up, after he read the paper.
It may precede but not command its antecedent
- After he read the paper, the old man stood up.
It may command but not precede its antecedent
- After the old man read the paper, he stood up.
But it can't do both
- *He stood up, after the old man read the paper.
That sentence is not ungrammatical, but he and the old man can't refer to the same person.
I agree with David. The first sentence may not be technically right, but its comprehensibility overrules the big insertion of a clause in the second. Most people reading the sentence will give a clear understanding that "their" refers to mathematicians. The second sentence has a complete thought, with something separate jammed in the middle. If this is done over and over again in an excerpt, the reader would have a harder time understanding.
There is ambiguity, but at the same time, because of how much we're used to using certain methods of language, there is no ambiguity.
Also, the first sentence could be reworded into:
Mathematicians can use these theorems as an advantage.
or
The use of these theorems provide Mathematicians with a definite advantage.
Plus some wording depending on the context. :)
Hope this helps!