The Infinite Tsukuyomi does not affect Hashirama, Tobirama, Hiruzen and Minato because they are reanimated. Hagoromo, the Sage of the Six Paths, appears and explains to the four that Hashirama and Madara are the reincarnations of his sons Ashura and Indra. Hagoromo recounts the tale of how he founded Ninshu, the Ninja Creed, and about the lives of Ashura and Indra.
And unlike when
you were inside of me,
،وليس كما كنتم بداخلي
Und auch wenn ihr nicht mehr in mir weilt,
werdet ihr den rechten Pfad beschreiten.
Y al contrario que cuando estuvieron conmigo,
los guiarán por el camino correcto.
Y al contrario que cuando estabais conmigo,
os guiarán por el camino correcto.
E, diversamente 
da quando dormivate dentro di me,
E diferente de quando
estavam dentro de mim,