Electronic hobbyist project-short circuit detector
Assume the switch is open on power-up.


On power-up Q1 and Q2 will be off.
A current will flow through R1 - U1 - R2 - U2 lighting both LEDs dimly. The voltage at the bottom of U1 will be about 2.5 V.
Q2 will now have voltage on the base so it will turn on.
Q2 turning on will turn on Q1. This will short out U1 turning the top LED off and giving full voltage to R2 - U2 making this go bright.
If the switch is closed (short-circuited) the top LED will go full brightness and there will be no voltage across the lower LED so it will turn off.


Note that when the switch is closed there will be a momentary short-circuit on Q1 while Q2 turns off. This is not a very good design.


  
  Will this circuit work? 
  


Yes, although Q1 is under a bit of stress sometimes.


  
  If so,what is the logic behind the working of the circuit. 
  


Explained above.


  
  Does anyone have an idea of how the resistance values are calculated.
  



For the LEDs you choose a value that limits the current to a safe value. Since you need about 2 V for the LED you need to drop 3 V across the series resistor so you have \$ V \$. Next choose the current you want through the LED and you have \$ I \$. Then use Ohm's Law to find R. \$ R = \frac {V}{I} \$.
R3 and R6 aren't needed as there is a lower resistance path to ground through the lower LED.
R4 and R5 are chosen to supply enough base current to turn the transistors hard-on.