While fighting Orochimaru, Sandaime Hokage Hiruzen stated that a person killed by Death Soul Reaper Jutsu will have his soul imprisoned in the Soul Reaper's body for eternity and will be restless there. How can they be reanimated then? And in the event that they are reanimated, what will happen when they are released from reanimation? Will they go back to the Soul Reaper or will they rest in peace?
Yes and no!
The Death Soul Reaper Jutsu (aka Dead Demon Consuming Seal) (aka Shiki Fūjin) is a sealing technique. While the soul is sealed with the Death Gods belly, it can not be resurrected using Impure World Resurrection.
However, like most sealing jutsu shown in the series, there is a way to release the seal. This is done by the using the using the releasing jutsu along with a particular mask from the Uzumaki clan. After the soul is released, it is possible to revive them using Impure World Resurection as shown by Orochimaru when he revived all the previous Hokage and his arms after the Third Hokage had sealed them using Dead Demon Consuming Seal.
Reanimation is done by using person cells and bringing back their soul. Reapers Death seal locks away the soul within reapers belly so soul cannot escape. So Souls sealed by using reaper death seal cannot be reanimated. But if the reapers belly is cut the souls sealed inside escapes and then they can be reanimated as they are not locked up. It is clearly explained in the narutos 'episode 365 : those who dance in the shadows'
Q. Sandaime Hokage Hiruzen stated that a person killed by Death Soul Reaper Jutsu will have his soul imprisoned in the Soul Reaper's body for eternity and will be restless there. How can they be reanimated then?
A. They CAN'T be reanimated because their soul is not residing in the Pure World.
It is clearly stated in the wiki page of Impure World Reincarnation(emphasis mine),
To perform this technique, the user must first acquire some of the DNA of the person they intend to reincarnate. Kabuto remarks that this basically amounts to grave-robbing, although blood stains or organs salvaged after the target's death also work. The soul of the intended reincarnated must also reside in the pure world (浄土, jōdo); for example, those whose souls have been consumed by the Death God cannot be reincarnated. However, if it is a case where the souls are freed from inside the Shinigami, then a user of this technique is free to reincarnate them once again.
Q. And in the event that they are reanimated, what will happen when they are released from reanimation? Will they go back to the Soul Reaper or will they rest in peace?
A. Since they cannot be reanimated, they can't be released from it either. Their souls stay in the Death Reaper stomach forever (or) or until they're released by someone by cutting open the Death Reaper's stomach.
It is true that the caster and the target that is the victim of the death reaper seal cannot be reanimated. We get to know this when Kabuto explains the mechanism of the Death Reaper seal.
So the only event on which a person sealed using the Death Reaper can be reanimated is if and only if the person has been released from the belly of the death reaper.
Now, what happens if they are released from the reanimation? Well they simply go back to the world of the dead where the soul of the dead resides. Since after the belly of the death reaper is cut and the souls trapped there released, the souls must go back to the world of the dead and only then can it be summoned for reanimation.