Check for the connection on the side of the rear screen if it is connected.
The rear defogger lines make a circuit, if the circuit is broken at any point (common cause - tinting, stickers, khich k kapra marna inside), then the defogger won't work.
Take your car to an electrician and let him check the circuit.
Heater is a different thing - make sure your car has thermostat valve installed and working properly.