When you joined the new company, you should have disclosed that you have an ESI number. I am afraid, how could they register you with a new ESI number when the system will reject the application if you put the same telephone number, bank account number, and Aadhaar (which is not mandatory now, I presume) in the registration fields? If you have put a different telephone number, etc., registration could be possible. But if that was done by the employer purposefully so that the new employees do not take sick leaves, then the issue will take a different turn.
I must say that if the employer has created a new ESI registration even after you declared that you had ESI, there are two possibilities. One is to keep the old one active by meeting the ESIC or to demand maternity benefits from the employer. An employee covered by ESI but not eligible to get maternity benefits from the ESIC due to the reason that she does not meet the contributory conditions will have to be given the benefits by the employer by virtue of Section 5A of the Maternity Benefits Act.