It occurred to me that the problem may be that the KinematicBody2D is pushing the RigidBody2D away, so that their collision shapes never actually overlap.
If I change the mode property of the RigidBody2D to MODE_KINEMATIC, then the RigidBody2D doesn't get pushed, and a collision is detected. However, the collision shapes doesn't overlap in this case either, so my reasoning above may be faulty.