9-Speed Ultegra (6500) with Mountainbike Derailleur
All nine speed Shimano shifters index with all pre-ten-speed Shimano MTB derailleurs.
All nine speed long cage MTB derailleurs with long (SGS) cages will have total capacity sufficient to run any cassette they can clear with a double in front.
36t large cog cassettes came out late in 9-speed mountain's life. Only a very few Shimano 9 MTB derailleurs are rated to clear a 36t for their largest cog spec. Most do 34 and a few only 32.
The SRAM you have is a 1:1 and has no compatibility with the shifter.