The Federal Election Committee's Congressional candidates and committees campaign guide (212-page PDF) has lots of information about how campaigns must be run under federal law.
All candidates for US Federal offices with over $5000 of donations or expenditures are required to register a campaign committee with the FEC. Campaign donations are generally accepted by the campaign committee (not the candidate himself/herself) and disbursed by same.
Within 15 days after an individual becomes a candidate as described in Section 1, he or she must designate a principal campaign committee. This designation is made by filing either a Statement of Candidacy (FEC Form 2) or a letter with the same information. 101.1(a) and 102.12(a).
Within 10 days after it has been designated by the candidate, the principal campaign committee must register with the FEC by filing a Statement of Organization (FEC Form 1). 52 U.S.C. §§ 30102(g), 30103(a); 102.1(a).
This committee would probably still exist after the candidate's death,* and would be responsible for any decisions regarding the disposition of remaining campaign funds at that time (just as if the candidate had withdrawn from the race.) So by law, the answer is "the campaign committee".
The FEC does place restrictions on what a campaign can do with leftover funds, but the options are:
- Settling debts. Note, in fact, that the campaign committee cannot terminate its operations if it has any outstanding debts or obligations. (p. 137 of the FEC guide)
- Start a non-profit organization.
- Convert to a multicandidate committee (this is really just a special type of non-profit, I suppose.)
- Donate the unused funds to charity.
- Donate the unused funds to another candidate's committee, subject to a $2000 limit. (p. 19)
- Donate the unused funds to a party organization (no limit as far as I can tell.)
- The treasurer's idea of paying off the debts is in fact required by law before the committee can wind down its operations.
- The campaign committee can't send more than $2000 directly to any other federal candidate, so John's wife and John's replacement are constrained in this regard.
Beyond that, where the funds end up will depend on who is on the campaign committee and what procedures the committee uses to make decisions.
*Technically, it appears to be legal for the candidate to be both treasurer and custodian of records for their own campaign — which are the only two positions on the committee required by law. It is conceivable that a campaign organized in this way could end up with "orphaned" funds, without anyone authorized to dispose of them. I'm not sure what would happen in this case.