A ramp is a tool. People who use tools as part of their professions are taught that the use of the correct tool for the work is what permits efficiency and longevity, both in form and in function. This applies to both the tool and the user.
Once again, a ramp is a tool. What work must it do? What conditions? What will use the tool, and how? These may sound like weird questions about a hobby, but they are very important if you don't want to waste time, materials, and money, and if enjoyment of the tool is going to be important in the end.
Logging railroads had steep grades, but they also had special tools. Their locomotives were purpose-built, just as were the tracks on which they performed their work...including the grades/ramps. Terrain dictated what grades were necessary to get to where the collected resources were. If they were too bad, steam donkeys were used to relay the logs down to where the trains could safely go.
You have constraints. One of them is space. Another is the weight and tractive effort of your chief tools, your engines. You need to determine how much of a grade your chief tools will manage. You can do tests on the basement or living room floor to determine the highest grade your trains will work for a given number of cars (called the load). If you will necessarily have to build curves into the grade, you will learn that your train will have to be somewhat shorter because grades suffer when curves are incorporated. Or rather, the engines do.
This is a long way to say that no one can answer your question but you. It would be a sound investment of time to do mockups of various grades and determine "..what the maximum grade for incline in HO" is for your particular circumstances. My engines are not the same as yours, most likely, and my space is not like yours. So my engines will behave differently on my grades.
I hope that helps to orient you to the solution you need.