For the second year in a row, the 103-year-old technology giant was the Dow Jones industrial average’s worst performer. The company has spent billions on stock buybacks and is investing a fraction of what rivals do in R&D.