For instance, a candidate for a legislature promises to vote yes or no, on a specific piece of legislation, or perhaps agrees to introduce a bill that is written at the time the contract is signed. The contract does not give the candidate anything in exchange for that vote or agreement to introduce legislation (as this would obvioulsy be bribery), but if he does not carry through with the agreement could be sued in court, and be financially liable? I am specifically wondering about the USA, but if someone knows if this is viable elsewhere I'd be interested as well.
The contract does not give the candidate anything in exchange for that vote or agreement to introduce legislation (as this would obviously be bribery)
In that case there is no contract. In order for an agreement to be a valid contract there must be an exchange of consideration. That is, each party to the contract must promise to give the other something of value. Since nobody is giving our hypothetical legislator anything of value, there is no consideration, and thus no contract. The purported "contract" is merely a pledge, and the legislator may suffer political consequences for breaking it, but it wouldn't be legally actionable.
In point of fact, politicians in the US (and I imagine elsewhere too) make such pledges all the time. Notable examples include the 1994 "Contract with America" (not a contract, despite the title) and the "Taxpayer Protection Pledge" this decade. These pledges are usually written vaguely enough that politicians can wriggle out of them, but sometimes they break them pretty obviously. George H. W. Bush's "Read My Lips" pledge is a famous example of the latter. What followed is pretty illustrative of the value of such pledges: his political opponents made some hay out of it for a while, late-night comedians had a field day with it, and then some other news happened and everybody pretty much forgot the whole thing.
Since you're asking if he could be sued in court and be held liable, you need to look at this from a legal perspective.
Who would have standing to sue Congressman Smith for breaking his oath?
Since no one paid him for making the promise, no one is out any money. Its not at all clear who the aggrieved party would be.
Lots of people may be unhappy about the broken promise, but unhappy and actually injured are not the same thing.
Why exactly does the hypothetical Congressman have a duty to uphold his end of the contract? If there is no "other-side" to the contract, since the other party didn't give him any money, or promise to provide re-election help, or anything else, there isn't really a contract, and he doesn't have a legal duty to keep up his promise.
Would the injured party seek an writ of mandamus, ordering the politician to vote according to the contract? It seems highly inappropriate for the court to interfere with the business of a Legislative body. (separation of powers and all that).
Would the injured party seek financial compensation? They aren't out any money for a contract that went unfulfilled, since you specified they didn't actually exchange money (or other goods). If the legislation were something like a tax-bill or a trade tariff, maybe the injured party did suffer financially, but lots of legislation has financial impacts.
Even if the suit does make it before the court, the Congressman would have some pretty easy defenses. He could give virtually any reason for changing his mind between signing the contract and actually casting his vote: The economic conditions changed. The political situation was changed. Different legislation was introduced. A committee report came out with new information..... anything.
He has a duty to vote his conscience with the best information available, and as information is constantly changing, it'd be pretty easy to give a good reason for changing his mind and getting the suit dismissed.