[SOLVED] Right way to query for all the train lines in a region?

Hello,

I used to following OverpassTurbo query to retrieve all the train lines in Sicily:


[out:json][timeout:25];

//Sicily: 39152
rel(39152);map_to_area -> .searchArea;

(
  node["railway"="rail"](area.searchArea);
  way["railway"="rail"](area.searchArea);
);

out body;
>;
out skel qt;

It seems to work, but I was wondering if this was the right way to query train routes open to the public, ie. ignoring freight service + stations.

Thank you.


Edit: Mmm… it’s turning into a 2.5MB file, with ten’s of tiny tracks:

Is there a better query, or at least a way to join all those tracks into something more manageable?