Remove the mattresses from the bunk beds and set them aside. Eliminate the possibility that the squeak is coming from the mattress and not the bed frame.
Push on the bunk bed frame as hard as you can and look for any loose boards or slats. If you see any loose boards or other issues, stop using the bunk bed until it has been repaired.
Start at one end of the bunk bed and slowly work your way to the other end. Feel along the bed frame for loose or missing nails. Pound any loose nails back into the bed frame and replace any missing nails. Missing and loose nails can cause squeaks and other noises in a bunk bed.
Move the bunk bed around and listen for any remaining squeaks. Isolate the source of any noise and lubricate that area with a quality spray lubricant.
Search for any remaining squeaks in the bunk bed frame. Place the mattresses back on the bed and check again for squeaks. Reposition the mattress if squeaks are coming from mattress placement. Flipping the mattress can reduce squeaks.