It means that Tom admires Martha's quality as politician. Similarly 'Tom admires Martha as a mother' is not ambiguous (unless Tom is short for Thomasina).
If you put the "as a politician" at the front of the sentence then it does, indeed, reverse the meaning. In that case we are saying that Tom, in his capacity as a polititcian, admires Martha generally.
This becomes clearer if we have two descriptions such as:
Tom, as a politician, admires Martha as an activist.
or
As a politician Tom admires Martha as an activist
There is no ambiguity in this, Tom is a politician and Martha is an activist. Each descriptive phrase relates to the noun closest to it.
The man saw the boy with the binoculars. / They are hunting dogs. ...
– Edwin Ashworth Mar 08 '21 at 15:25