"Hero" by Mariah Carey does not appear to be in the soundtrack of any film. But Carey claims that this was intended for the 1992 Dustin Hoffman movie, also called Hero.
Walter Afanasieff explained in Fred Bronson's Book of Billboard #1s that the original plan was that Gloria Estefan would be asked to sing the title theme. He was recording the Music Box album with Carey at the time, and during a break he, "was sitting at the piano and told Mariah about this movie. Within two hours, we had this incredible seed for this song, 'Hero’.
Afanasieff added: "It was never meant for Mariah to sing. In her mind, we were writing a song for Gloria Estefan for this movie. And we went into an area that Mariah didn't really go into - in her words, it was a little bit too schmaltzy or too pop ballady or too old-fashioned as far as melody and lyrics."
When it was nearly finished, they played the song to the president and COO of Sony Music Entertainment and Carey's fiancé Tommy Mottola, (later her husband), telling that it was a song for the film ‘Hero’. Afanasieff remembered that Mottola responded, "Are you kidding me? You can't give this song to this movie. This is too good. Mariah, you have to take this song. You have to do it."