In a significant legal setback for two of the tech industry’s giants, Apple Inc. and Qualcomm Inc. have lost their bid to relocate a patent infringement lawsuit from Texas to California.