First principles: Even assuming they somehow magically knew there really were no smallarms on the ship, why take the risk of getting stabbed or beaten with a pipe or trapping you and starting a fire or whatever. It would be another thing if the ship surrendered, but no reason to put yourself and your fellow soldiers at risk to go easy on your enemy.
Deeper reason: With long range missiles and drones being the primary threat to a ship, the biggest limitations are actually locating the enemy ship, tracking it and guiding the missile/drones towards it. Even a ship with no ammo can do that by relaying your position to another ship or shore based missiles/drones. So pulling your ship right next to an enemy one and having to stay there while your marines go board it is not a safe thing to do.
EDIT: According to the Indian ministry of defense, the ship was taking part in live fire component of the naval exercise. So they did bring ammo to the exercise. Unless they brought exactly the ammo they spent on the excersise, they had ammo.