Don't merge the BAM files if you want to visualize them using different colors in UCSC genome browser. The UCSC color settings can not be controlled from/within the BAM file. You should upload them separately and change color settings in their config files that goes along with the bam files in UCSC genome browser. I have never done something like this before so I am not sure if it can be done but this page should be able to help you : https://genome.ucsc.edu/goldenPath/help/bam.html
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
IGV might work better than the UCSC genome browser for your application.