While booking the ticket, select the checkbox “book only if at least 1 lower berth is allotted”. If lower berth is available you would get confirmed booking on the lower berth, but if the berth is not available it would ask for reconfirmation if you want to book the ticket even if no lower berth is available.