Kerala to Hampi or vice versa essentially involves multiple connections.
There are no direct connections from any of the major towns in Kerala to Hospet, which is the nearest railway station for Hampi.
By far train is the best possible option to travel to Hampi from Kerala. Though Hospet is the nearest railway station for Hampi, there are no direct trains (not yet at the time of writing this!) from Kerala that travel via Hospet.
But you have two broad choices. Travel to Goa and then travel to Hospet (and Hampi). Or travel to Guntakal Jn and then look for a connection to Hospet.
Of the two there are some half a dozen trains connect Kerala with Goa along the Konkan coast.
To Guntakal there are only two trains (the Mumbai Express Train No:16332; and the daily Kanyakumari Mumbai Jayanti Express Train No:16382 ).
From Goa to Hampi opt for a train connection to Hospet ( Howrah Express , Train No:18048 ) or even there are overnight buses from Goa to Hospet.
While this may not be the shortest, you may also consider a third train option, that is via Bangalore. You can catch that overnight Hampi Express (Train number 16592) from Bangalore to Hospet.
By there way there is a 12 hour or so bus (Rajahamsa service by KSRTC ) connection from Mangalore to Hopset. If you are traveling from the northern part of Kerala, explore the feasibility of this option too.
See also other travel options to reach Hampi.
This map details the location of Hampi in Karnataka, India. This web site has many maps on the Hampi ruins site. You may be also interested in Distance to Hampi from various places.
1 Day Hampi Itinerary
Before we jump into the one day Hampi itinerary, let's understand a few things. The attractions in Hampi is spread around a very large area (25sq km). Accessing these these involve a good deal of walk (trek), cross the river in a coracle, ride a moped or even hire a local taxi (auto rickshaw). Even in the best scenario, you would have walked almost 3-5 hours of the day.
3 Day Hampi Itinerary
The scale and spread of the sites in Hampi demands you to plan for many days to explore Hampi. The following gives an idea on how to plan your Hampi exploration strategy.