To eat each other, they would have to be significantly different in size. I would replace your top, which sounds like a standard aquarium top, with a screen top. Tree frogs require good ventilation and they are not likely to escape when there is a screen top in place.
Just to clarify things, the sand is under water right? Posting pictures of the enclosure will help a lot. Also posting your country and location in your profile will help even more in the long run.