Actually mam its not illegal ..
Its our Railway's Rule to allow pax to travel in sleeper class by paying fare difference or allowing waitinglist passengers to travel in sleeper class ..
If rule is like this what pax will do ...
Just complain this on twitter ...