Just found a solution, I just separated all the rails in photoshop and made them appear and disappear at different times and layer in my animation and it works great but thanks for your tips I’ll remember it !
The marble and the rails are already two separated layers, the marble needs to be in front of the rails for all the loops and needs to be behind just at the end when it leaves..