Paris and Madrid are over 1,000km apart, so it's really not a situation where the two cities are interchangeable.
From Madrid, you can reach Lisbon by sleeper train or a series of daytime connections. The overnight sleeper takes about 9.5 hours, running once per night. By daytime train, it will take pretty much the entire day; if you follow the Man in Seat 61's suggested itinerary, you'll leave at 8am and arrive at 8pm.
From Paris, you can take the TGV to the Spanish border, then connect to a Sud Express sleeper train to Lisbon. You'd leave Paris at 12:52 and arrive in Lisbon about 7:30 the next morning.
Given the amount of time these journeys require, I'd give serious consideration to flying instead. There are also bus options available, taking 8-9 hours from Madrid to Lisbon.
If you're an Indian citizen, you need a Schengen visa for your entire trip, which would cover your time in Lisbon and your time spent in France and/or Spain.