why output of RC low pass filter is ramping up when square wave is applied?
Initially the voltage across the capacitor is 0V. 

During the 20ms 3V pulse the voltage across the capacitor is close to 3V. Hence a current of 3/200e3 A will flow into the capacitor and charge it a bit. Voltage across the capacitor rises a bit.

During the remaining 80ms 0V pulse the voltage across the capacitor is rather small. Therefore only a very small current will flow out of the capacitor and discharge it. This discharge is smaller than what you put into the capacitor during the charge phase. The voltage across the capacitor drops, but just a tiny bit.

Therefore over time the voltage slowly rises and you get your staircase pattern. It's more zig-zag really.

Extend the simulation time to 12 seconds and you'll see the typical decay that you might expect:


If you don't put a limit on the number of pulses and let the simulation run again you'll see that the voltage averages out at roughly 660mV. 

This is the low-pass filtered result of your 20% duty cycled square wave. Note that ideally the voltage should be 600mV. The 10% difference come from the non zero rise- and fall time of your square wave.