SHORT ANSWER
Suppose a President can see that such a vote is coming and will pass,
shortly before an election. Can that President resign just before the
vote in order to effectively avoid the disqualification penalty?
Probably yes.
But, there is no historical precedent for this happening. Nixon resigned before the House voted to impeach him, not midway into the impeachment proceedings. Neither Andrew Jackson nor Bill Clinton resigned prior to not being convicted on the basis of a U.S. House impeachment.
Several federal judges and one cabinet official, however, have resigned midway through impeachment proceedings prior to being convicted, and in those cases, the case was dismissed and no judgment was entered by the U.S. Senate, so they were not disqualified from holding future federal public offices.
LONG ANSWER
Relevant Constitutional Language
The pertinent provisions of the U.S. Constitution include the following:
Article I, Section 2, Clause 5:
The House of Representatives shall chuse their Speaker and other
Officers; and shall have the sole Power of Impeachment.
Article I, Section 3, Clauses 6 and 7:
6: The Senate shall have the sole Power to try all Impeachments. When
sitting for that Purpose, they shall be on Oath or Affirmation. When
the President of the United States is tried, the Chief Justice shall
preside: And no Person shall be convicted without the Concurrence of
two thirds of the Members present.
7: Judgment in Cases of impeachment shall not extend further than to
removal from Office, and disqualification to hold and enjoy any Office
of honor, Trust or Profit under the United States: but the Party
convicted shall nevertheless be liable and subject to Indictment,
Trial, Judgment and Punishment, according to Law.
Article II, Section 4:
The President, Vice President and all civil Officers of the United
States, shall be removed from Office on Impeachment for, and
Conviction of, Treason, Bribery, or other high Crimes and
Misdemeanors.
Article II, Section 2, Clause 3:
The Trial of all Crimes, except in Cases of Impeachment, shall be by
Jury; and such Trial shall be held in the State where the said Crimes
shall have been committed; but when not committed within any State,
the Trial shall be at such Place or Places as the Congress may by Law
have directed.
Analysis
The key language is in Article I, Section 3, Clause 7 of the U.S. Constitution which states in the pertinent part that:
Judgment in Cases of impeachment shall not extend further than to
removal from Office, and disqualification to hold and enjoy any Office
of honor, Trust or Profit under the United States[.]
This means that a President who is impeached by the House and convicted by the U.S. Senate may be prohibited from holding any federal office from President to dogcatcher in the future.
But, this can only be done in a "judgment" of the U.S. Senate in connection with an impeachment based upon a conviction in the U.S. Senate following a House impeachment, which has never happened.
The history of the impeachment language and the limitation to removals from office, suggest that only a person who is current serving in office may be impeached. Otherwise, the proceeding would be invalid as moot, and would be dismissed (as it has been in the case of many judges who have resigned after investigations are initiated or after a House impeaches but prior to a conviction of impeachment).
A U.S. Senate ruling that someone is disqualified from holding future office can only be entered in a judgment of conviction for impeachment, so cannot apply to a past President. If this were done it would probably be an invalid "Bill of Attainder" or "Ex Post Facto" law. See U.S. Constitution, Article I, Section 9, Clause 3 ("No Bill of Attainder or ex post facto Law shall be passed").
And, the U.S. Senate can't pass a law unilaterally, or enter a judgment convicting someone on an impeachment unless the House initiates the proceeding.
There is no precedent concerning whether if someone who was convicted by the U.S. Senate and removed from office based upon an impeachment initiated by the U.S. House, in which the judgment did not disqualify the person impeachment from holding future federal public offices, the U.S. Senate could amend its judgment later on to also disqualify the person so removed from office from holding further public office.
I suspect that if the question were presented that the federal courts would hold that the amendment of the impeachment judgment was not valid because the word "judgment" implies an immediate ruling upon a case and not a perpetual right to hold the person subject to the judgment in limbo regarding the consequences of his impeachment conviction.