How to use multiple hyphens

Solution 1:

Your first attempt is correct. The second is wrong. Let me begin with the second sentence. To me, "This is the second-highest rated 4-star hotel in Dehli" says something about how tall the building is. That is, among all 4-star hotels that have been given a formal rating, this hotel is the second-highest. In contrast, your first sentence correctly explains that it is the rating that is the second highest.

Having considered correctness, I think that it is then worth considering how best to say what you want to say, and in that case, the construction suggested by @Jason is easy to understand and unambiguous.