Does file1 have anything in it other than the ranges? (If not, it isn't needed for this project.)
Can there be more than 1 line in file2 that fits into the same 500 count interval? If there are two input lines in the same interval, are two output lines produced for that interval or are the two lines from file2 merged onto a single line in file3? (If they are merged, is there any limit to the number of lines that should be merged into a single output line?)
Is file2 always sorted by increasing numeric value in the 1st and 2nd fields (as in your example)?
--------------
Update...
Can we assume that the last line of your sample output should have been: