Each line can be selected for each station, while hiding the others. To select the line write e.g. {{SWT Stations|Weymouth =y}}
Line codes:
Weymouth=y
Salisbury=y
Portsmouth Direct=y
Hampshire Locals=y
Romsey=y
Lymington=y
SWML Local=y
Alton=y
Windsor=y
Reading=y
Hounslow=y
Chessington=y
Epsom=y
Hampton Court=y
Woking=y
GuildfordN=y
Kingston=y
Add None in station articles for routes which are not relevant. e.g. where on the long distance SWML (Weymouth Line Services): to produce the box write {{SWT Stations|Weymouth =y|IL None=y|Suburban None=y}}