The quickest and easiest way is to fly from Delhi to Kathmandu, but it is more expensive than the bus or the train. There are six different airlines. It is cheaper to flight from Delhi to Kathmandu than from Varanasi to Kathmandu, even if Varanasi is closer from Kathmandu.
If you want to take the train, there is no train that connects Kathmandu, so you have to take a train from Delhi to Gorakhpur (in India). Then you take a three hours bus to get to the border (in Sunauli), here you will get your visa, and then take a bus from the border to Kathmandu. It is better to take a train that arrives early in the morning to Gorakhpur, because buses from the Sunauli border to Kathmandu leave until 11 am (there are still buses that leave in the evening but it is longer). So I advise you to take the train from Delhi that leaves at 3:30 pm and arrives in Gorakpur ar 5:50 am (It is the Asr Kir Express). In 2AC class it costs around 1100 rupees. Then the bus from Sunauli costs around 500 rupees.
If you take the bus from Delhi to Kathmandu, it will be very long, between one or two days.