CBI detains guilty railway official