Your queue and the compareTo
method are likely working correctly. Note what the API says about it:
This class and its iterator implement all of the optional methods of the Collection and Iterator interfaces. The Iterator provided in method iterator() is not guaranteed to traverse the elements of the priority queue in any particular order. If you need ordered traversal, consider using Arrays.sort(pq.toArray()).
The order is apparent when you retrieve items from the queue via the operations poll, remove, peek, and element.