I booked 4 Tatkal tickets from Visakhapatnam to Secunderabad and cancelled after 5 min. 1 hour later train was cancelled due to technical problems. Will I get refund or not?
Any cancellation caused due to the Indian Railway's inability to provide accommodation is always refunded 100%, but technically in your case at the point of cancellation, Railways did not cancel the train so, unfortunately you wont get a refund.
In fact I realised this last week, that if the train is already cancelled prior to your action (or even if it was decided and implemented on the system) you wont even be able to cancel your ticket online (Confirmed with an ex railway colleague of mine who is still working with Railways).
Unfortunately I am not able to quote a rule here, because all rules talk about is who initiates the action of cancellation (x or y) and not about if after x happens after y and generally whatever is applicable at that point of time is not reversed due to an action happening later.