Does the word "militate" have the same definition in the next two sentences?

To militate against the possibility of his election.

Politeness militated against this opinion being expressed.
the same meaning