Short answer: no, they are not both correct; and they are not the same.
To start, strictly speaking conditional sentences should use the subjunctive mood, so in this case you should arguably use "if he were"; but this rule is often ignored (or considered irrelevant) so I'm using "If he was" in the following.
The 2nd conditional is used for scenarios that are possible. This can refer to events at present and in the future. With your first sentence you suggest that it is possible that he is a hero, and therefore you can say, using present tense (which makes this a 2nd conditional):
If he were a hero, he'd be a hero our city has, but doesn't need."
If you refer to the past - you don't know whether in the past he was a hero or not, but make an observation on that past for the possible case that he was - then "would be" is not appropriate, since it refers to the future. You should use instead:
If he was a hero, he was a hero our city had, but didn't need.
The former might be considered unusual or incorrect by some people.
For completeness, you should consider the 3rd conditional, which is used for scenarios that are impossible. This always refers to a known past, where reality is different from the scenario discussed - so the condition is imaginary. Using the 3rd conditional, you could say
If he had been a hero, he would have been a hero our city had, but didn't need.
This implies that in reality (or in your opinion) he was not a hero.