Railways accepts resignation