Not really. It was a story that a philosophy book used to illustrate a conundrum. It bore resemblance to "actually happened" like a film "based on true events". Are we taking the word of the cops and philosophers or does the man himself have something to say about it? What would have happened if the cops didn't beat the man? We will never know.
But ok, let's grant it, for the sake of argument. For our purposes, it is the unvarnished reality, precisely as the book said. The cops had to beat the man or the child would have died.
The beating of the man had unknown consequences, however, and the construction of the scenario elides them. Is it worth it to live in a society where cops beat thieves to extract information from them? We don't have to guess. Look around you (I mean, assuming you live in the US or similar country in that respect). Do cops only beat men to extract life-saving information from them? The unintended consequence of "it's okay to beat this man just this once" is readily apparent. It never is just the once in that exceedingly rare scenario, is it?
Now, you can answer my question. In the magical society where cops do not beat people, but then do, is 100 beatings and 1 or 2 deaths worth the life of 1 child?
As it happens, we know what would've happened had the police not beat him, because they tried that first. The man refused to say where the car was. He would rather let a child die than admit to car theft. Of course, maybe, if they had let the child die a magic genie would've prevented all future crime - it's as plausible as your hypothetical - so maybe the police did wrong after all...
As for your question my moral judgements are tuned to reality, not nonsense fantasy land. I don't have a strong sense of what is right and wrong in a universe that does not obey causality as I know it. I would, however, be willing to beat the thief if it were my child in the car.
The problem is that these quandaries are then used to justify shitty behavior in other circumstances. What percentage of cop beatings save lives versus total cop beatings? 0.2%? 0.02%? What's the point of your question? What does the knowledge that you will be beaten if a cop suspects you of a terrible crime do to your state of mind? To the safety of police officers? To society?
I'm concocting a situation that I would like you to consider. Answer, please, with just as much gravitas. Let us imagine a society where beating or harassing anyone is absolutely taboo. In this society, no one need ever worry about physical violence. A woman could walk naked from Chicago to California never once being harassed. An elderly man could walk anywhere carrying a fat wallet of cash without fear of physical violence.
There is the rare and occasional thief, however. Now, one of these thieves steals a car and leaves a child baking in the sun in much the circumstances you describe. Beating the thief is the only possible way to save the child from a grizzly, horrendous, agonizing death, screaming alone for her mother.
But, once done, the beating breaks that taboo. Those police officers are a bit more likely to use violence to get what they want. It's a bit contagious, too. Other people begin to use violence. Bear with me, here. Let's say, because that taboo is broken, 100 more people are beaten over the next decade, and 1 or 2 of them die from their injuries. None of them "deserve" it.
Would you say it was worth it, to beat the man to save the life of that child, knowing that 1 or 2 people die and 100 are beaten, directly because of that?