I had a similar issue a little while back with my White's Tree Frogs. One of them stopped eating and passed away, the vet told me that it was a parasite but I had trouble treating it with the medicine he gave me and eventually the frog just died. I was afraid for a while that the other frog in the same tank was sick as well, but he began eating again shortly after the other passed and it now active and croaking as usual.

I would take the frog to a vet if you can, sounds like whatever illness your first frog had has passed onto the other. Good luck, I hope the little guy pulls through.