In a relay based two-tier sensor network the individual sensor nodes, constituting the lower tier of the network, are partitioned into clusters and transmit their data directly to their respective cluster heads. Higher-powered relay nodes act as cluster heads and form the upper tier of the sensor network, that communicates received data to the base station. In this model, if a relay node becomes faulty, all data from the cluster of the faulty node, as well as data from other clusters that is routed through the faulty node will be lost. To avoid this potentially large data loss, it is critical that, after a failure is detected, data is rerouted as quickly as possible to avoid the failed relay node. This is best achieved by allowing each individual relay node to take corrective action immediately after discovering that a relay node is faulty, without any directive from the base station. Furthermore, it is also important to ensure that the energy dissipation of the relay nodes, using the new route, is as low as possible. In this paper, we propose a novel approach, where only the nodes originally transmitting to the failed node has to change their routing information, and all other nodes continue to operate as before. This greatly simplifies the coordination and synchronization required to establish a new routing scheme, resulting in a faster response time and reduced data loss. We have proposed an integer linear program (ILP) formulation that determines a routing scheme using this approach. We also present a simple but effective heuristic, capable of handling much larger networks. Our simulation results clearly demonstrate that the proposed approach can lead to significant improvements in the lifetime of a two tier network, compared to existing techniques.