No, there is no direct train from Lima to Cusco. The easiest way to get to Cusco is by taking a flight or bus from Lima. Once you arrive in Cusco, you can take a train or bus to Machu Picchu. Alternatively, you could take a luxury train from Arequipa or Puno if you're willing to spend more.