I am not a lawyer or otherwise expert of US immigration law but it is my understanding that the ESTA and the Visa Waiver Program are two distinct things. The language on the US State Department's VWP website seems quite clear:
Travelers must be eligible to use the VWP and have a valid Electronic System for Travel Authorization (ESTA) approval prior to travel.
(This sentence implies that being eligible on the one hand and having a valid ESTA on the other hand are two separate requirements.)
You must meet all of the following requirements to travel to the United States on the VWP:
[…]
Each Traveler Must have authorization under ESTA
In order to travel without a visa on the VWP, you must have authorization through the Electronic System for Travel Authorization (ESTA) prior to boarding a U.S. bound air or sea carrier.
[…]
Previous Compliance and No Prior Visa Ineligibilities
If you have had a U.S. visa before or previously traveled to the United States under the VWP or another status, you must have complied with the conditions of previous admissions to the United States, and you must not have previously been found ineligible for a U.S. visa.
Here again, having an ESTA and having no prior visa ineligibilities are two separate requirements and the site does specify that you must meet all requirements. So if you have been found ineligible for a U.S. visa, you cannot enter under the VWP, period. Under that logic, when you applied for the ESTA, whether it is still valid, etc. become immaterial, you simply cannot legally enter the US without a visa anymore.
Your only option would then be reapplying for a visa, addressing the issue raised in the rejection letter.