It's possible, but there are limitations.
Improvements and modifications to your home can also be deducted from your income as medical expenses if they are medically necessary.
The cost of installing entrance or exit ramps, modifying bathrooms, lowering cabinets, widening doors and hallways and adding handrails, among others, are home improvements that can be deducted as medical expenses. But the deduction amounts must be reasonable, given their medical purpose, and expenses incurred for aesthetic or architectural reasons cannot be deducted.
If the railings increase the value of the home, you would have to reduce the deduction by the amount of the increase in value. See page
6 of IRS Publication 502.