Fish might eat anything they can fit in their mouth.
It might have eaten a dead on. How unusual being able to see it in the fish!
If you have had the tank running only this month it isn't likely cycled, with a full colony of Beneficial Bacteria in the filter media.
Fish start dying off when the water parameters are in the unsafe, to danger/critical zone.
What are your water parameters, since the other Endler was found dead, I worry about they amounts of Ammonia, nitrIte and Nitrate.
The AA article link my signature is very useful.
Getting a series of water changes would be in order after a death, either way. If you have test results you would want to make sure the parameters would be
ammonia 0
NitrIte 0
NitrAte about 40-60 at the most.
Maybe 3 water changes of about 25% each time - about a few hours apart.
Until you get the water safe again.