Giving away children does not come under self-mortification. Self-mortification is torturing the physical body.
“Venerable Nàgasena, do all the Bodhisattas give away their wives and
children, or was it only Vessantara?” “All of them do.” “But do those
wives and children consent to it?” “The wives do but the children do
not due to their tender age.” “But was it then a meritorious deed if
the children were terrified and cried at being given away?” “Yes it
was. As a man desiring merit might take a cripple wherever he wanted
to go in an ox-cart and thereby the oxen would be made to suffer; or
as a king might levy a tax in order to perform a great meritorious
deed; so too, giving, though it may cause anguish to some, is
conducive to rebirth in heaven. Is there, king, any gift that should
not be given?” “Yes, Nàgasena, there are ten kinds of gifts that
should not be given, the giving of which leads to rebirth in states of
woe: a gift of intoxicants, of a festival, of a woman, of a man,of
suggestive designs, weapons, poisons, chains or instruments of
torture, fowls and swine, or false weights and measures.” “I am not
asking about gifts that are not approved of in the world. I am asking
if there is any gift that should not be given when there is someone
worthy of it.” “Then, Nàgasena, there is no gift that should not be
given. When satisfaction in Dhamma has arisen, some people give a
hundred thousand, or a kingdom or even their life.” “Then why do you
criticize the gift of Vessantara so harshly? Is it not sometimes the
case that a man in debt may sell his son or leave him as a pledge?
Just so, Vessantara gave his son as a pledge against his future
attainment of omniscience.” “Nevertheless, why did he not give himself
instead?” “Because that was not what was asked for. To offer something
else would have been ignoble. Furthermore, O king, Vessantara knew
that the Brahmin would be unable to keep the children as slaves for
long since he was advanced in years. Anyway, he knew their grandfather
would pay a ransom for their return.” “Skilfully, Nàgasena, has this
puzzle been unravelled. The net of heresy has been torn to pieces.
Well has the letter of the scriptures been maintained while you have
thus explained the spirit. This is so and I accept it as you say.” - Milinda Panha