There is no direct connection from Kanpur to Nepalgunj. However, you can take the train to Burhwal (BUW), take the train to Biswan (BVN), then take the drive to Nepalgunj. Alternatively, you can drive from Kanpur to Nepalgunj in around 3 h 52 min.
From Kanpur Central (CNB) train to Burhwal (BUW), train to Biswan (BVN), then drive to Nepalgunj. 8 h 38 min $42. From Kanpur drive to Nepalgunj. 3 h 52 min $27.