A federal judge in Massachusetts has denied Eli Lilly and Co.'s motion to dismiss a lawsuit filed by its competitor Teva Pharmaceutical, allowing a patent dispute over migraine prevention treatment to continue.