Hi Balu,
You can't do this in GeoDa bc it doesn't support line files but the steps to generate a gal or gwt spatial weights file based on railway routes would be:
Let's say you have rail stops that are part of a route (point file) for destinations, and for origins, centroids of building parcels or some other unit.
You can use GTFS feeds/sth like OpenTrip Planner to calculate travel times between your points of origin and destination. This will get you a matrix eg of origins in rows to destinations in columns (or an NxN matrix if you use e.g. block or tract centroids
for origins and destinations).
Next step would be to convert this matrix to a gwt weights file that you can then load into GeoDa.
If you don't need travel times but just distance, you could use the steps above with street network distance instead.
Best,
Julia
Julia Koschinsky, Ph.D.
Executive Director and Senior Research
Associate
Center for Spatial Data Science
University of Chicago