ya, thats why he HAD to defeat roxas. Roxas was going to try to destroy kingdom hearts and xemnas would have destroyed roxas before he had the chance. Riku needed roxas in order to wake up sora so riku defeated roxas and brought him back to diz where they then put him into the alternate twilight town to keep him sake and protected until sora can finally wake up.