When considering the evolutionary relationships between these animals, the pair that is most closely related is snakes and crocodiles. Although it might not seem obvious at first, snakes and crocodiles share a more recent common ancestor compared to snakes and frogs.
Both snakes and crocodiles belong to the class Reptilia and share characteristics of reptiles, such as scaly skin and similar reproductive strategies, whereas frogs belong to a different class, Amphibia. The divergence of amphibians (which includes frogs) from reptiles happened much earlier in evolutionary history, making snakes and frogs more distantly related.
In summary, while all these animals are fascinating, the evolutionary ties between snakes and crocodiles are much closer, placing them on a more similar branch of the tree of life.