Most major train routes would take you to Mannheim from where you can catch a regional train to Heidelberg which only takes approximately 15 minutes. once at Heidelberg's Hauptbahnhof (main station) the city centre is a manageable walk (approx 20 minutes) or an short tram ride away.