The Aruch Hashulchan (1829–1908) in YD 251:7 quotes this gemara in the context of the laws of giving tzeddakah vs sustaining oneself:
והיינו באיש אינו מרויח רק חיי נפש, לחם צר ומים לחץ, דחייו קודמין
thus man was not profiting only that he can sustain himself with simple bread and water since his life takes precedence.
In terms of a child vs. ...
Before I can address your main question, I need to explore your premise further, as the way it's presented is either false or misleading. Before I can do that, I need to discuss a different Gemara on the topic.
Dispute regarding when one gives up his life
Sanhedrin 74a cites a dispute between R' Yishmael and R' Yochanan (quoting R' Shimon ben Yehotzadak ...