In Abrahamic religions, owning both ordinary and sex slaves was legal. What do Hindu scriptures say about owning people as slaves? Did Rama and Krishna free any slaves?
There were no slaves in the Hindu world like the equivalent of it in the western world
The above statement is true.But we do have the concept of "dasa/dasi" or servants or (some translate it as) slaves.But they are not the same as say sex slaves or war slaves."Servant" is the more proper word here not "slave".
The dasa or dasis are there to help the householder in his daily duties/chores.In return they get shelter,wages,fooding etc.
Few references of slaves/servants/dasa/bhritya from Scriptures are given below:
8.363. Yet he who secretly converses with such women, or with female slaves kept by one (master), and with female ascetics, shall be compelled to pay a small fine.(Manu smriti)
4.180. With his father and his mother, with female relatives, with a brother, with his son and his wife, with his daughter and with his slaves, let him not have quarrels.(Manu smriti)
The following verse also shows that the dasas(servants/slaves) are to be treated with due respect:
3.116. After the Brahmanas, the kinsmen, and the servants have dined, the householder and his wife may afterwards eat what remains.(Manu Smriti).
I have found further references in Parashara Smriti as well.
No, Hinduism forbids forced slavery, i.e. enslaving of others.
Verses from various Dharma Shastras:
Nārada (Theft, 28).—‘he who steals a man shall have to pay the highest fine; he who steals a woman shall be deprived of his entire wealth; and he who steals a maiden shall suffer corporal punishment.’
Bṛhaspati (22. 27-28).—‘In the case of women, men, gold, gems, the property of a deity or a Brāhmaṇa, silk and other precious things, the fine shall be equal to the value of the article stolen; or double that amount shall he inflicted as fine; or the thief shall be executed.’
Do. (22.18; Vivādaratnākara, p. 317)—‘Those who steal human beings should be burnt by the slow fire of chaff.’
Vyāsa (Do.).—‘The stealer of women shall be burnt on an iron bed by the slow fire of chaff; the stealer of man should have his hands and feet cut off and then exposed on the road-crossing. He who steals a man should he fined the highest amercement; he who steals a woman should have his entire property confiscated; and he who steals a maiden shall he put to death.’
Śaṅkha-Likhita (Do., p. 318).—‘For stealing a king’s son, the fine is 108 kārṣāpaṇas, or corporal punishment; half of that for stealing persons of the royal family, or of men and women in general.’
However, there are other ways one can enter slavery according to the Manusmriti:
There are seven kinds of slaves—(1) captured under a banner, (2) slave on food, (3) born in the house, (4) bought, (5) presented, (6) hereditary, and (7) slave by punishment.—(8.415)
Above it has been cited that forced slavery is immoral, but why is this verse allowing it? The commentator Medhatithi answers:
Hence, ‘Dhvajinī’ means the army; he who is captured ‘under the banner’ is the captive of war, who is made a slave.
“What is stated here,—does it refer to the Kṣatriya,—the meaning being that the Kṣatriya made captive in war becomes a slave?”
Not so, we reply; since it is the Śūdra that forms the subject-matter of the context; as is clear from the preceding statement—‘it is for the purpose of servitude that he has been created.’ What the text refers to is the case where the owner of the slave having been defeated in battle, the slave is brought over and enslaved by the captor.
The next verse says even the wife and the son are "slaves" to the father:
The wive, the son and the slave,—these three are declared to have no property; whatever they acquire is the property of him to whom they belong.—(416)
Also, there is a difference between slavery and servitude according to Narada:
All this however is not right. ‘Serving’ is one thing and ‘slavery’ is another. Slavery consists in doing servile work, and in not objecting to going anywhere he may be sent to; while ‘service’ may consist in shampooing the body, guarding the family or property and so forth. All this has been dealt with in detail by Nārada.
And here Medhatithi is saying that the duty of Shudras is servitude and not slavery:
“When the Śūdra works as a slave entirely through considerations of his duty, why should there be only seven kinds of slaves?”
There is no force in this objection. Because in his case ‘slavery’ is not innate in him; it is purely voluntary wish him; he having recourse to it only with a view to acquiring merit. And further, such a slave cannot be given away or pledged;—as the bought and house-born slaves can. In fact the Śūdra in question is guided by what has been declared (under 10.128) regarding the Śūdra ‘imitating the behaviour of the virtuous, etc., etc.’; and by this it is clearly implied that slavery is not inherent in him; he takes to it only with a view to a definite result. Hence there is real ‘slavery’ only when it is involuntary. So that if a Śūdra has property of his own and lives upon it, not supporting himself by depending upon the Brāhmaṇa and others, he does nothing wrong.