(1)When any person accused of a bailable or non-bailable offence and apparently a juvenile is arrested or detained or appears or is brought before a Juvenile Court, such person shall, notwithstanding anything contained in the Code of Criminal Procedure, 1973, or in any other law for the time being in force, be released on bail with or without surety but he shall not be so released if there appear reasonable grounds for believing that the release is likely to bring him into association with any known criminal or expose him to moral danger or that his release would defeat the ends of justice.