MongoDB Replica Set & Data Sync behavior
If you have modified X nodes priority at rs.conf() higher number than Y node, switch over should automatically happen WHEN X has replicated all information from Y node. Not before that. If switch doesn't happen, check rs.printSlaveReplicationInfo() that your X is really 0 second behind. It sounds like that your Y is so slow that even X cannot read opLog fast enough and keeps lagging that why.