A ruling by India's Supreme Court has ended a three-decade-long royal feud that involved a "fake" will.