The basic principle is that that which is harmful to the individual is prohibited, because Allah, may He be exalted, says:
{And do not kill yourselves} [An-Nisa’ 4:29]
{and do not throw [yourselves] with your [own] hands into destruction [by refraining]. And do good; indeed, Allah loves the doers of good} [Al-Baqarah 2:195].
The Prophet (blessings and peace of Allah be upon him) said: “There should be neither harming nor reciprocating harm.” Narrated by Ahmad and Ibn Majah (2341); classed as sahih by al-Albani in Sahih Ibn Majah.
If inhaling the smoke of these herbs is harmful, then it is haram to consume it.
If it is not harmful – rather it is of medicinal benefit, as you said – then there is nothing wrong with it, because the basic principle is that things are permissible.
You should consult specialists who have knowledge of the hoped-for benefit and can determine whether that can be achieved by burning these herbs or not.
And Allah knows best.