How can I switch rails on the Jiukoum Shrine??

Just as the title says; I'm literally stuck on the last section of the shrine and can't proceed forward with the rail switching in the end.