One may vote for an unworthy candidate only when this is necessary to prevent a still less worthy candidate from obtaining office; but in such a case one should explain the reason for his action if this is possible. In an exceptional case one may vote for some unworthy candidate; viz., if he can thereby avert some unusually great personal disadvantage. (Fr Jone, Moral Theology, n. 295)
Has the formality or the ratio of the object of voting been changed?
The formality of the object of the act is not necessitated. Whether someone is "worthy" of the office is separable in reason from what one judges to be the consequences of his being in office.
I used to lean towards thinking that it was consequentialism and in so far as one ignores what should be the intrinsic morality of the act of voting it does appear to be such. It is one thing to choose someone who ones knows is unworthy and to deliberately do so. It is another to change the ratio of the act of voting from being an act of distributive justice to one of choosing the better option in a rigged system in view of possible consequences.
The object of the act itself can be changed by reason or differ in reason. Am I cutting off an arm to injure another? Or am I cutting off an arm to save his life? The physical act is the same -- the formal object of the act differs.
One could argue that because political office is linked to the common good that choosing someone for political office is therefore an act of distributive justice. I would contend the problem here is that political office, especially in the United States, is not tied to the common good by virtue of the inappropriate size of the political organization and its history. For a similar argument regarding the modern nation-state based on its history, see William Cavanaugh. Because political office, by the very structure of the nation-state, is not tied to the common good it is already an illegitimate use of power to command others. By the fact that it is a tyranny, there is no way to exercise distributive justice to begin with.
Re: the example of casuistry in the OP then,
So taking the ideal example of a true polity which respects the common good --
1. if all of those worthy for office for some reason refused to accept an office or to be considered for office and this is something that could not be changed
2. and one was left with two unworthy candidates, one being less unworthy than the other
3. It seems that in such a case distributive justice cannot be exercised, and the voter is not culpable for this being so (though the culpability of those refusing to take office may differ) -- and one is justified in choosing the less worthy candidate because of the common good.
In the example of a system that is rigged by those who actually hold power so that one is presented with candidates one would not choose otherwise and there are no remedies for this tyranny (peaceful or violent), then the culpability of the injustice falls on those responsible for preserving the system, and not on the voter.