Yup,executing them would be perfectly legal under the rules of land warfare,but torturing them would NOT be legal. It would be a war crime.
I would agree in the case of low-level soldiers captured in a place like Afghanistan. In the case of a senior terrorist or a member of a terrorist organization captured on American soil, I'd say hand them over to the School of the Americas with orders to get any information they could out of them and then kill them.