Well, rusting is an exothermic process (which is why it... well... happens), so in theory you could extract energy from it... but it's quite slow, so you wouldn't be able to get much energy out of it.
Although there is the method by which hydrogen was first created, by running a little bit of...