First, are you sure that it is definitely rust, and not chocolate spot ?- not that it matters an awful lot if there are only a few pods left.
Pick the remaining pods, and as long as the beans themselves are clean when podded it`s perfectly ok to eat them.
Dig up and burn (or otherwise destroy) the plants as soon as you have finished picking. Don`t compost as both rust and chocolate spot fungi can overwinter.
Plants are more susceptible to both fungi if they are fed with nitrogen. As I have mentioned before on this site, don`t give them general fertilizers, which they don`t need - just potash, which makes them harder. And try to keep them in a 4 year rotation.