EC to implement SC ruling on caste, religion