Assuming that you're starting from the UK, the answer is 'Yes'.
You can travel freely within the Schengen countries, without any documentation at all (other than which might be required by the carrier for security purposes). So you could travel to France, by rail, from Spaiin, Germany or even from Hungary without needing a passport.
But, for travel from the UK (which is not a full signatory to the Schengen Agreement) you need a passport for travel to any other country, irrespective of the method of travel. The only exception (for British & Irish citizens) is that no passport is needed to travel between the UK and the Irish Republic.
Chris