James William Koustenis, 57, a postal employe who twice won awards for improving a mail sorting device, died Sunday following a heart attack at his home in Silver Hill, Md.

In 1971, Mr. Koustenis, who began his Postal Service Special Achievement Award for developing a system that feeds mail into a sorter by mechanical means. Earlier, he had shared a $1,500 award for his work on the same device. His invention was credited with doubling the capacity of sorting machines from 15,000 to 30,000 pieces of mail per hour and saving the Postal Service $2 million.

Mr. Koustenis was born in Washington and graduated from McKinley High School. He was a Golden Gloves boxer before joining the Post Office. He served in the Navy during World War II and in the Korea n conflict.

At the time of his death, he was plant manager of the Postal Service's Merrifield bulk mail center.

Survivors include his wife, Pauline, of the home in Silver Hill; four children, Bill, of the home, Perry, of Wardorf, Md., Tina, of the home, and Mrs. Shea Leiter, of York, Pa.; four brothers, Steve, of Silver Spring, Md., George, of pinehurst, N.C., John, of Wheaton, Md., and Nick, of Fairfax; and two sisters, Helen Koustenis, of Hillcrest Heights, Md., and Jennie Margelos, of Ashton, Md.