Hi Nandana,
So if you read the OSRM api documentation you may be able to see profile use to get the route either from car , bike or foot in this way you can get the path for the “walking way”.
I’m attaching the image you can refer, hope this helps.
Then it might possible for that there drive and walking route is same, you can test this on osm-demo
I have tested this, I’m attaching couple of images for different route profile on same path.