To get S ranks in the main boss battles, you will be ranked based on how much health you have at the end of the match. I recommend trying to go for S rank after you play it again in the Ninja World Timeline. Choose the Hero path, as you can equip health items to your ninja tools set. Right before you beat the enemy, use these items in order to heal yourself as much as possible. Health is the only deciding factor in this Storm game for S rank.
You only have to S rank one of the routes in the Hero/Legend choice. There is no need to do both. Thanks to Syaoran369 for this information!