My granddaughters take melatonin 3mg or Benadryl (diphenhydramine) 50mg for sleep each night. Is this safe. They are 10 and 12 years old.

Melatonin. If effective and as recommended by a child specialist. I would not advise high dose on regular basis, though. Parents need to review with their doctor the reasons for lack of sleep and remedy those.
NO. It is not safe for pre-adolescent or adolescents for that matter to be taking any sleeping aids of any type. At this age sleep should be a common end of the days activities. Please advise accordingly.