It could, as it did against Russia in Ukraine v. Russia (2022). But note that in Ukraine v. Russia it specifically cited the resolution adopted by the General Assembly under Uniting for Peace addressing the Russia invasion as a violation of the UN Charter as a violation of the sovereignty and territorial integrity of another UN member, that is, it was addressing an operation already declared illegal independent of the issue before the Court.
Ordering a halt to an operation that otherwise might fall within the recognized UN Charter right if individual or collective self-defense is, especially when the allegedly aggressing party is not subject to the order, seems pretty hard to justify as a provisional measure.
(One might also note the absence of an effect of that order in Ukraine v. Russia.)
Its a punt by an organization that has always been useless except to tut tut people and regimes the West doesn't like.
[1] I mean child as is used colloquially, not as "under 18" in the manner is often disingenuously used.
No, it didn't order Hamas to do anything, as it has no authority to order non-state actors. It, in the last of the paragraphs that are part of the discussion and not part of the provisional measures that constitute the binding orders, “calls on” Hamas and other armed groups to release all hostages immediately and unconditionally.