Yes, it will affect them
The only requirement in Inspiring Leader is that the creatures
can see or hear you and who can understand you
Both Skeletons and Zombies can see and hear, and, if they were able to speak Common in life, they most likely can understand you as well. To the best of my knowledge, nothing stops any of them from getting Temporary Hit Points (nothing stating so in p. 198 from the PHB, at least, and nothing in the monsters' stat blocks either). I won't quote the section entirely to back it up because it's rather large. It's part of the SRD though so you can read it, e.g., in the roll20 site.
Therefore, they are allowed to get temporary hit points, and they satisfy the criteria for Inspiring Leader, thus, it should affect them.
A quick note on its usefulness: with their subpar AC, temporary hit points are not amazing on such creatures anyway, so I don't see how allowing it is imbalanced in any way, although you can argue it is weird in terms of flavor.