Here is what Wikipedia has to say about it:
After Iwo Jima was declared secured, the Marines estimated there were no more than 300 Japanese left alive in the island's warren of caves and tunnels. In fact, there were close to 3,000. The Japanese bushido code of honor, coupled with effective propaganda which portrayed American G.I.s as ruthless animals, prevented surrender for many Japanese soldiers. Those who could not bring themselves to commit suicide hid in the caves during the day and came out at night to prowl for provisions. Some did eventually surrender and were surprised that the Americans often received them with compassion, offering water, cigarettes, or coffee. The last of these holdouts on the island, two of Lieutenant Toshihiko Ohno's men, Yamakage Kufuku and Matsudo Linsoki, lasted six years without being caught and finally surrendered in 1951 (another source gives the date of surrender as January 6, 1949).
So it sounds like they didn't really think the war was still going on, but more like they though they would have to surrender if they came out and were caught, and they were right. I just thought you might want to know.