Nothing wrong in what they did. If you're waitlisted, and your boarding a reserved compartment, you yourself are a reason of all the inconvenience you subject yourself to.
In fact the act of Indian Railways of allowing waitlisted passengers in reserved compartments is unfair. Such people should be STRICTLY not allowed.
.
"log sochte h ticket kharid Liya to poori train unki ho gayi"...
more... is the most illogical and frustrating line I've heard over and over in my life.
THEY paid for it. THEY reserved it. THEY deserve the space there. YOU DO NOT. End of story.